Skip to content

Minifying prelude saves 9KB on all compiles #762

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dave opened this issue Feb 25, 2018 · 1 comment
Closed

Minifying prelude saves 9KB on all compiles #762

dave opened this issue Feb 25, 2018 · 1 comment

Comments

@dave
Copy link
Contributor

dave commented Feb 25, 2018

The prelude (added to the top of every generated command) is plain JS, and can't be minified by the compiler. #761 adds a manually minified version of the prelude (I used https://skalman.github.io/UglifyJS-online/). This saves 9KB on the minified file size.

@dave dave changed the title Minifying prelude would save 9KB on all compiles Minifying prelude saves 9KB on all compiles Feb 25, 2018
@dmitshur
Copy link
Member

dmitshur commented Feb 26, 2018

Thanks for the suggestion.

As far as I know, for all production uses, GopherJS output is both minified and gzip-compressed. So it's important to compare minify+gzip numbers too.

I ran the numbers:

Prelude removeWhitespace(Prelude) PreludeMinified
no compression 56489 41690 32762
gzip-compressed 12360 10540 9322

So, realistically, it's a savings of 1218 bytes that have to go over the wire. Of course, it's more bytes (8928) that need to be parsed/processed by the JS engine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants