-
Notifications
You must be signed in to change notification settings - Fork 175
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
Don't require image bin deps till necessary #125
Conversation
What's the problem? And you need to show some numbers. |
The problem/solution is from @cowboy #123 (comment) The test target in this repo will not show the benefit For those repos only using one or two of the optimizers, they will not get the penalty of requiring the bin just to resolve a path they won't use. |
Just did a quick benchmark with this. Seems a bit faster: shama in ~/Documents/www/grunt-contrib/imagemin on master*
$ time grunt imagemin
Running "imagemin:dist" (imagemin) task
✔ test/fixtures/test.png (saved 10.14 kB)
✔ test/fixtures/test.jpg (saved 5.86 kB)
✔ test/fixtures/test.gif (saved 7 B)
✔ test/fixtures/test-uppercase.PNG (saved 10.14 kB)
✔ test/fixtures/test-uppercase.JPG (saved 5.86 kB)
✔ test/fixtures/test-uppercase.GIF (saved 7 B)
Minified 6 images (saved 32.01 kB)
Done, without errors.
real 0m1.623s
user 0m1.383s
sys 0m0.174s
shama in ~/Documents/www/grunt-contrib/imagemin on nschonni/lazy-require-deps*
$ time grunt imagemin
Running "imagemin:dist" (imagemin) task
✔ test/fixtures/test.png (saved 10.14 kB)
✔ test/fixtures/test.jpg (saved 5.86 kB)
✔ test/fixtures/test.gif (saved 7 B)
✔ test/fixtures/test-uppercase.PNG (saved 10.14 kB)
✔ test/fixtures/test-uppercase.JPG (saved 5.86 kB)
✔ test/fixtures/test-uppercase.GIF (saved 7 B)
Minified 6 images (saved 32.01 kB)
Done, without errors.
real 0m0.463s
user 0m0.412s
sys 0m0.054s |
Thanks @shama ! |
@sindresorhus anything else to change for this? |
@nschonni, this module is being rewritten (#97). The core has moved to https://github.com/kevva/image-min. Maybe we can change it there. |
@kevva I think the rewrite is a good idea, and this can definitely be upstreamed. I'd just like to see this land before that so people can get the benefit now. |
@sindresorhus should I close this |
Don't require image bin deps till necessary
@nschonni can you open a ticket on https://github.com/kevva/image-min/issues about fixing the actual loading speed problem? |
@kevva already did the same thing a few weeks ago https://github.com/kevva/image-min/blob/master/imagemin.js#L93 or where you thinking about a general performance issue? |
@nschonni i'd rather figure out why it's so slow to load. |
Related to gh-123