-
Notifications
You must be signed in to change notification settings - Fork 673
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
r.js 2.1.3 (and greater) is four times slower than 2.1.2 #451
Comments
My first guess is that it is the source map work, if you set generateSourceMaps: false, does that perform better? |
It doesn't seem to help. with 2.1.2: |
Looking at the things changed for 2.1.3: There was a fix for uglify2js, I was inlining it incorrectly so it was missing some content for some WHITESPACE_CHARS, fixed in #323, perhaps that would explain it? Another candidate may be #245 since it does some extra AST work, but that should only come into play if So, what may be interesting to try is to use |
Yup, I can confirm that Do I need to file a subsequent issue with Uglify2, citing this issue? |
Ideally, create a JS file you want to run through uglify-js. Try it with the stand-alone uglify-js and record the times between uglify1 and uglify2, and hopefully pass that JS file to the uglify folks to ask what accounts for the slow down. By generating the numbers with standalone uglifyjs, that will hopefully not confuse them by thinking it is an issue with r.js. Going to close this as it is something uglify will need to address itself. |
I'm not sure if this is related to the problem described above but it is worth mentioning that there is a known performance issue with uglify2 and pre-minified files mishoo/UglifyJS#321 |
$ wget -O r-2.1.2.js https://github.com/jrburke/r.js/raw/2.1.2/dist/r.js $ time /usr/bin/node r-2.1.2.js -o target/js-config/app.build.js real 1m9.357s user 1m8.717s sys 0m0.498s
$ wget -O r-2.1.3.js https://github.com/jrburke/r.js/raw/2.1.3/dist/r.js $ time /usr/bin/node r-2.1.3.js -o target/js-config/app.build.js real 4m31.063s user 4m29.710s sys 0m0.876s
This is with nodejs v0.10.7, Linux amd64.
app.build.js is {
"optimize": "uglify2"
, "optimizeCss": "standard"
, "generateSourceMaps":true
, "preserveLicenseComments":false
, "useStrict": true
} // and some other parts that I doubt are relevant; let me know if you need the specifics
The text was updated successfully, but these errors were encountered: