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

Speed up build process: min task #35

Open
mklabs opened this issue Apr 29, 2012 · 0 comments
Open

Speed up build process: min task #35

mklabs opened this issue Apr 29, 2012 · 0 comments
Milestone

Comments

@mklabs
Copy link
Owner

mklabs commented Apr 29, 2012

The script is pretty fast, node helps a lot here. Overall build times very much depends on the amount of javascript that is going to be minified.

js minificiation is quite costly, blocking and synchronous. Depending on application size and javascript codebase, the min task could easily take more than half of the overall build time, even if there were no changes to these sources.

  1. Manage a local cache of minified script, before / after minification. Compute content hash for pre-min script.
  2. If on subsequent build, the concatenated script that is going through the min task has not changed (by comparing previous sha1 for the file and the current one), then don't re-minify but use the cache version.

This little thing should drastically speed up the build script for mid-to-large sized app (this is handy for times when you're trying out different scripts build target or tweaking the config to see how it goes).


I suspect this to be the same for img optim, with sites with a lot of images. I didn't run into this issue yet though.

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

No branches or pull requests

1 participant