Closed Bug 837715 Opened 9 years ago Closed 9 years ago

Reduce compression rate for js source

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla21
blocking-b2g tef+
Tracking Status
firefox19 --- wontfix
firefox20 --- wontfix
firefox21 --- fixed
b2g18 --- fixed
b2g18-v1.0.0 --- fixed
b2g18-v1.0.1 --- fixed

People

(Reporter: jrmuizel, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

This cuts the time to compress gaia-email-opt.js from 0.63 seconds to 0.33 seconds.
The result should still be smaller (391K from 321K before) than the compressing with snappy or lz4 (528K), but decompression time will be worse. Fortunately, this will only penalize Function.toSource() which I think is an ok trade off.
Attachment #709732 - Flags: review?(benjamin)
Yes, definitely; penalize toSource() all you want. The real concern is memory usage. I'm CCing njn to see what he thinks about this. Could you possible see what the difference is memory-wise on desktop? There's a "script-sources" entry in about:memory.
"script-sources" numbers would be good.  Having said that, B2G has tighter constraints than desktop regarding both time and memory, so I'm ok with whatever works best with B2G.
(In reply to :Benjamin Peterson from comment #1)
> Yes, definitely; penalize toSource() all you want. The real concern is
> memory usage. I'm CCing njn to see what he thinks about this. Could you
> possible see what the difference is memory-wise on desktop? There's a
> "script-sources" entry in about:memory.

I'd expect a similar difference: about 15%-20% worse. The difference for minified source will be less, the difference for unminified larger.

gaia-email-opt.js - 22% increase
jquery.min.js - 16% increase
ga.js - 11% increase
gmail.js - 14% increase
Attachment #709732 - Flags: review?(benjamin) → review+
This should give a significant improvement in the email app start time.
blocking-b2g: --- → tef?
blocking-b2g: tef? → tef+
Please land asap!
blocking-b2g: tef? → tef+
https://hg.mozilla.org/mozilla-central/rev/eb8f60c782da
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
Quite surprisingly, this seems to have eliminated the kraken win that happened in bug 836515. I can't think of any reason that would happen as I would've expected an improvement.
I dont' see any regression on http://arewefastyet.com/.
You need to log in before you can comment on or make changes to this bug.