Skip to content
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

3x bigger than advertised? #139

Open
sdhull opened this issue Apr 25, 2018 · 2 comments
Open

3x bigger than advertised? #139

sdhull opened this issue Apr 25, 2018 · 2 comments

Comments

@sdhull
Copy link

sdhull commented Apr 25, 2018

Hi! Thanks for getting lodash usable with imports.

We're currently on ember 2.17, ember-lodash 4.17.6

EDIT: tl;dr the version of broccoli-concat-analyser I was using was calculating the compressed size incorrectly. Turns out it's not 144KB, it's more like 68KB. But still much larger than ~24KB, which is what I expected.

I was checking out our addon weight (using broccoli-concat-analyser) to find some low-hanging fruit to slim down vendor.js and noticed lodash taking up more space than I expected!
lodash is 144kb uglified + compressed
lodash is showing as ~144kb uglified + compressed, but lodash.com says the Full build (~24kB gzipped).

Maybe we're doing something incorrectly here? I tried using https://github.com/kellyselden/ember-cli-tree-shaker but it didn't do much, like ~4kb savings from our production build 😢
Any help would be greatly appreciated. Even if you could quickly try a production build using broccoli-concat-analyser and let me know if lodash shows as 144kb for you as well or smaller

@simonihmig
Copy link
Contributor

@sdhull are you using the latest version of broccoli-concat-analyser, that is 3.0? There was an issue with the way the compressed size was calculated, that I fixed a while ago: stefanpenner/broccoli-concat-analyser#20

@sdhull
Copy link
Author

sdhull commented Apr 26, 2018

Wow nice @simonihmig! I was using 2.1.0, and it was hard to believe that lodash could really be that big.

It's still larger than I expect (at ~68KB) but no longer an order of magnitude larger. Still makes me feel foolish to add it when we don't have tree-shaking yet and I only use a few lodash methods... 😐

But the vast differences in calculated size (between versions of broccoli-concat-analyser) make wonder how accurate the tool is. Should I take these numbers with a grain of salt or @simonihmig you feel confident the sizes are correctly calculated now?

screen shot 2018-04-26 at 1 25 55 am

@sdhull sdhull changed the title 10x bigger than advertised? 3x bigger than advertised? Apr 26, 2018
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