Minify the bundled Activity Stream code
Categories
(Firefox :: New Tab Page, enhancement)
Tracking
()
People
(Reporter: Felipe, Unassigned)
References
Details
(Whiteboard: [fxperf:p3][chore])
The Activity Stream bundle [1] is a huge file that contains a lot of comments and whitespace. It has sourcemaps, so minifying it should not cause debugging difficulties.
I threw it at a random minifier on the web, and the file was reduced by 52%, going from 486kB to 233kB. That was an aggressive minifier but I don't remember if it mangled var names.
I did a quick test on my code editor by just removing all comments and whitespace, but preserving everything else (including line breaks, names etc), and it still got a good reduction of 32%, to 330kB
We should at least give that a try to see what would be the performance benefits of that (specially for startup) to see if it's worth going down this road
Comment 1•6 years ago
|
||
Source maps are being removed in bug 1526452 (except for local activity stream development) and have only been packaged in non-beta/release builds. The bundle is generated with webpack, so minifying as part of the bundle process should be relatively straightforward assuming we do get a performance benefit without causing too much other problems (e.g., making uplifts more difficult as the whole file would most likely conflict)
Updated•6 years ago
|
Updated•6 years ago
|
Comment 2•6 years ago
|
||
There might be a trade-off here between the size of the bundled file, and additional overhead costs to "re-inflate" the minified file.
Do we have a good sense of what this would buy us? Have we done any experiments to see how this impacts start-up time?
Reporter | ||
Comment 3•6 years ago
|
||
I don't have a good idea, but now that we have startup_about_home_paint, let me do some manual investigation of what would be the impact. If it's any good we can send it over to AS for a proper implementation.
Reporter | ||
Comment 4•6 years ago
|
||
Using the startup_about_home_paint test, I didn't see any improvements on reducing the size of this file.
First I removed all comments and extra blank lines, preserving everything else. That removed about 120kB from the file (from 500kB):
https://treeherder.mozilla.org/perf.html#/compare?originalProject=mozilla-central&newProject=try&newRevision=aede7723abad91d4dd50cbbd441cb24e53813179&framework=1&selectedTimeRange=172800
Then I did a slightly more aggressive version by removing all indentation, while still preserving new lines. That removed some other 30kB. Same results
https://treeherder.mozilla.org/perf.html#/compare?originalProject=mozilla-central&newProject=try&newRevision=315f271d5b6d4b97a06c6dcfa69a985f733bc36f&framework=1&selectedTimeRange=172800
With these results, I didn't go further down the path of variable name shortening, etc..
Comment 5•6 years ago
|
||
I'm confused. If we're not seeing any improvement, why is this worth pursuing further, rather than just closing it with WONTFIX?
Updated•6 years ago
|
Reporter | ||
Comment 6•6 years ago
|
||
I don't think it's worth pursuing further at the moment. I left it open because in theory it's a valid request, but yeah it's better to just WONTFIX it.
Assignee | ||
Updated•6 years ago
|
Description
•