Comparing uglifyjs and google-closure-compiler

Hello :sunny: I’m maintaining elm-minify which uses terser under the hood. my results for Richards spa-example look like this:

commands

git clone git@github.com:rtfeldman/elm-spa-example.git

cd elm-spa-example

elm make src/Main.elm --optimize --output=elm.js

time elm-minify elm.js

output

 Initial size:     370448 bytes
Minified size:      93144 bytes
 Gzipped size:      29838 bytes (measured using Node.js zlib)

    real time:       4939 milliseconds
    user time:       6885 milliseconds
     sys time:        116 milliseconds

I don’t know exactly why the results are better in this case, but I guess the terser-folks have done more optimizations?

  • @christian, would you mind building your project with elm-minify once, sending me the results? I’d like to see how it performs with your much bigger project! :sunny:

  • has anyone measured the runtime using uglify and/or closure?

Yup, I call terser once, and haven’t had any issues :sunny: I did some comparisons for Richard here.

2 Likes