Closed
Bug 972657
Opened 10 years ago
Closed 10 years ago
Move the "is this script too small to compress?" check to a better place.
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla30
People
(Reporter: n.nethercote, Assigned: n.nethercote)
Details
Attachments
(1 file)
5.64 KB,
patch
|
Benjamin
:
review+
|
Details | Diff | Splinter Review |
In ScriptSource::setSourceCopy(), we skip compression if a script's length (in chars) is larger than HUGE_SCRIPT. In SourceCompressionTask::work(), we skip compression if a scripts size (in bytes) is smaller than COMPRESS_THRESHOLD. Moving the latter check into ScriptSource::setSourceCopy() would (a) put more of the logic in a single place, and (b) avoid putting no-op tasks on the compression worklists.
Assignee | ||
Comment 1•10 years ago
|
||
Note that the old threshold was in bytes, and the new one is in jschars, which explains the change from 512 to 256.
Attachment #8375922 -
Flags: review?(benjamin)
Comment 2•10 years ago
|
||
Comment on attachment 8375922 [details] [diff] [review] Move the "is this script too small to compress?" check to a better place. Review of attachment 8375922 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/jsscript.cpp @@ +1287,5 @@ > // - If the script is enormous, then decompression can take seconds. With > // lazy parsing, decompression is not uncommon, so this can significantly > // increase latency. > // - If there is only one core, then compression will contend with JS > // execution (which hurts benchmarketing). I can't tell if this is a typo or a clever coinage.
Attachment #8375922 -
Flags: review?(benjamin) → review+
Assignee | ||
Comment 3•10 years ago
|
||
>> benchmarketing).
>
> I can't tell if this is a typo or a clever coinage.
Neither! It's an old phrase used to describe optimizations that mostly help benchmarks, not real code. E.g. daylight savings offset caches, things like that.
Assignee | ||
Comment 4•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/27777c768b68
Comment 5•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/27777c768b68
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
Assignee | ||
Comment 6•10 years ago
|
||
Talos liked this patch a lot:
> Improvement: Mozilla-Inbound-Non-PGO - Tab Animation Test - Ubuntu HW 12.04 x64 - 5.92% decrease
> Improvement: Mozilla-Inbound-Non-PGO - Tab Animation Test - WINNT 6.2 x64 - 4.41% decrease
> Improvement: Mozilla-Inbound-Non-PGO - Paint - WINNT 6.2 x64 - 10.1% decrease
> Improvement: Mozilla-Inbound-Non-PGO - Tab Animation Test - WINNT 5.1 (ix) - 3.36% decrease
> Improvement: Mozilla-Inbound-Non-PGO - Tab Animation Test - WINNT 6.1 (ix) - 3.54% decrease
> Improvement: Mozilla-Inbound-Non-PGO - Tab Animation Test - Ubuntu HW 12.04 - 3.26% decrease
> Improvement: Mozilla-Inbound-Non-PGO - Paint - WINNT 6.1 (ix) - 5.73% decrease
Which was surprising... I thought this patch would have miniscule performance effects, because it merely avoided a small amount of worklist processing.
You need to log in
before you can comment on or make changes to this bug.
Description
•