Skip to content

Very bad performance with --compress #917

@perlun

Description

@perlun

Hi,

We are seeing severe performance degradation when the --compress option is being used, in terms of "compilation speed". With the following command line:

$ time node_modules/gulp-uglify/node_modules/uglify-js/bin/uglifyjs --compress --mangle -- ./ui/vendor/jquery-1*.js ./ui/vendor/lodash-*.js ./ui/vendor/jquery.*.js ./ui/vendor/jszip.js ./ui/vendor/ember-1*.js ./ui/vendor/loader-*.js ./ui/vendor/ember-resolver-*.js ./ui/vendor/bootstrap-datepicker.js ./ui/vendor/**/*.js

...

real    2m48.377s
user    2m33.172s
sys 0m4.416s

If I disable the --compress option and only use --mangle, things are reasonably fast (5s for this input set). If I disable both of them, it's blistering fast - less than a second.

Total length of the .js files being minified in this case is around 118k lines.

Any suggestions? Using uglify-js 2.6.0 at the moment, running on node v4.1.1 (but have seen similar speeds elsewhere, in Travis builds).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions