js-min-bench minifier comparison

This page compares JavaScript minifiers for various inputs across various settings.

Note: the input programs are not comparable against one another because they do wildly different things. Don't compare "angularjs" against "react", but rather for a given input program compare the different minifiers (uglify vs closure etc.).

See the README for more background on the methodology. Click on rows/columns of the results to see their definitions.

Note: many of these are marked 'untested'. See the discussion in the README of why you should treat those results with suspicion.

test results

input+tool+variantsizegzipbrotliruntime
angular-hello
raw 1,246,962226,37818.2%198,55215.9%
uglify 500,98640.2%112,1529.0%102,9818.3%1.2s
+ compress-mangle215,41617.3%62,3625.0%58,3694.7%4.4s
terser 500,98840.2%112,1539.0%102,9828.3%1.0s
+ compress-mangle215,64617.3%62,3085.0%58,3044.7%4.4s
closure 273,56421.9%80,6096.5%75,4026.0%3.6s
+ advanced221,01117.7%73,6365.9%69,8535.6%4.1s
j8tfailed (hover for details)0.0s
angularjs
raw 1,270,821309,87524.4%267,37021.0%
uglify 323,82025.5%83,2436.6%77,3676.1%0.7s
+ compress-mangle176,08513.9%59,9604.7%56,8584.5%4.8s
terser 323,82625.5%83,2486.6%77,3706.1%1.6s
+ compress-mangle175,91413.8%60,2814.7%57,1034.5%6.7s
closure 176,71713.9%62,0884.9%58,5484.6%3.1s
+ advanced149,00911.7%59,4464.7%56,7834.5%4.4s
j8tfailed (hover for details)0.0s
fake-10mb-angular
raw 10,166,5682,475,36424.3%267,3802.6%
uglify 2,590,56025.5%662,1996.5%78,4370.8%3.9s
+ compress-mangle1,408,77113.9%474,4744.7%57,8860.6%20.9s
terser 2,590,60825.5%662,2356.5%78,4380.8%3.9s
+ compress-mangle1,407,30513.8%477,3104.7%57,7770.6%23.4s
closure 1,403,41413.8%487,3804.8%70,4340.7%16.9s
+ advanced1,186,31911.7%468,2294.6%58,4200.6%25.2s
j8tfailed (hover for details)0.0s
react
raw 31,1248,92628.7%8,48427.3%
uglify 13,30642.8%3,79612.2%3,63711.7%0.3s
+ compress-mangle6,52020.9%2,7368.8%2,5818.3%0.6s
terser 13,30642.8%3,79612.2%3,63711.7%0.3s
+ compress-mangle6,50420.9%2,7838.9%2,6218.4%0.6s
closure 6,50020.9%2,7899.0%2,6398.5%0.6s
+ advanced5,35717.2%2,4387.8%2,2807.3%0.8s
j8tfailed (hover for details)0.0s
react-dom
raw 427,605100,80023.6%90,16921.1%
uglify 221,56351.8%45,48710.6%42,1549.9%0.6s
+ compress-mangle101,70123.8%32,0307.5%30,3767.1%3.0s
terser 221,56351.8%45,48710.6%42,1549.9%0.6s
+ compress-mangle102,80324.0%32,7267.7%30,9497.2%3.1s
closure 93,69421.9%30,6617.2%28,7746.7%1.9s
+ advanced74,72017.5%27,1456.3%26,3556.2%2.5s
j8tfailed (hover for details)0.0s
todomvc-react
raw703,818159,41522.7%137,28619.5%
uglify342,02248.6%77,76811.0%69,7249.9%0.8s
+ compress-mangle193,87527.5%58,4978.3%53,6417.6%3.7s
terser342,02248.6%77,76811.0%69,7249.9%0.8s
+ compress-mangle193,99727.6%58,5778.3%53,7527.6%3.7s
closure189,91727.0%58,8988.4%54,1767.7%2.0s
+ advanced148,00721.0%54,4707.7%51,0057.2%3.0s
j8tfailed (hover for details)0.0s
todomvc-vanillajs
raw31,6139,04928.6%8,55227.1%
uglify18,35858.1%5,26216.6%4,94015.6%0.2s
+ compress-mangle13,76543.5%4,47914.2%4,16413.2%0.5s
terser18,35858.1%5,26216.6%4,94015.6%0.3s
+ compress-mangle13,77443.6%4,51114.3%4,18913.3%0.5s
closure13,68243.3%4,54314.4%4,24513.4%0.6s
+ advanced11,82637.4%4,27313.5%3,99312.6%0.9s
j8tfailed (hover for details)0.0s
vue
raw 280,47276,23327.2%70,02325.0%
uglify 173,16561.7%49,29617.6%46,47516.6%0.5s
+ compress-mangle103,42636.9%37,68613.4%36,26212.9%2.6s
terser 173,16661.7%49,29717.6%46,47416.6%0.6s
+ compress-mangle103,46136.9%37,75013.5%36,29112.9%2.6s
closure 102,60136.6%38,56513.8%36,66313.1%1.7s
+ advanced91,59132.7%37,23513.3%35,56912.7%2.0s
j8tfailed (hover for details)0.0s

tool details

raw
raw input file, as baseline for comparison
uglify
uglifyjs 3.5.6
$ node_modules/.bin/uglifyjs %%in%% -o %%out%%
compress-mangle
$ node_modules/.bin/uglifyjs %%in%% -o %%out%% --compress --mangle
terser
terser 3.17.0
$ node_modules/.bin/terser %%in%% -o %%out%%
compress-mangle
$ node_modules/.bin/terser %%in%% -o %%out%% --compress --mangle
closure
Google Closure Compiler 20190415
$ node_modules/google-closure-compiler-linux/compiler --jscomp_off=checkVars --warning_level=QUIET --language_out=ECMASCRIPT_2015 --js_output_file=%%out%% %%in%%
advanced
$ node_modules/google-closure-compiler-linux/compiler --jscomp_off=checkVars --warning_level=QUIET --language_out=ECMASCRIPT_2015 -O advanced third_party/externs.js %%externs%% --js_output_file=%%out%% %%in%%
j8t
j8t (work in progress)
$ ../j8t/target/release/j8t %%in%% > %%out%%

output details

gzip
gzip -9 size in bytes, supported by ~all browsers
brotli
brotli -9 size in bytes, supported by many browsers
runtime
time taken to generate output, in seconds, not including compression