Closed kzc closed 7 years ago
thanks! Am always surprised when gzip takes two files and makes the larger one smaller than the smaller one.
Yeah, you can never predict what gzip will produce.
Note: Node v7.x has a significant performance regression with the instanceof operator that makes uglify twice as slow. Reportedly Node v8.x will fix this issue.
Just confirmed that node 8 does indeed resolve the instanceof
operator performance regression that slowed down uglify with node 7:
benchmark with node 6.9.0:
three.js (1.03 MB) without sourcemap:
✓ babili : 540 kB / 134 kB in 17.6s
✓ butternut : 515 kB / 129 kB in 1.5s
✓ closure : 513 kB / 129 kB in 1m 11s
✓ uglify : 509 kB / 128 kB in 3.9s
✓ uglify-mangle-only : 527 kB / 129 kB in 1.4s
✓ uglify-es : 509 kB / 128 kB in 4.9s
benchmark with node 7.7.3:
three.js (1.03 MB) without sourcemap:
✓ babili : 540 kB / 134 kB in 16.2s
✓ butternut : 515 kB / 129 kB in 1.9s
✓ closure : 513 kB / 129 kB in 1m 12.5s
✓ uglify : 509 kB / 128 kB in 6.1s
✓ uglify-mangle-only : 527 kB / 129 kB in 2.1s
✓ uglify-es : 509 kB / 128 kB in 7.6s
benchmark with node 8.0.0:
three.js (1.03 MB) without sourcemap:
✓ babili : 540 kB / 134 kB in 13.7s
✓ butternut : 515 kB / 129 kB in 1.3s
✓ closure : 513 kB / 129 kB in 1m 14.9s
✓ uglify : 509 kB / 128 kB in 3.7s
✓ uglify-mangle-only : 527 kB / 129 kB in 1.5s
✓ uglify-es : 509 kB / 128 kB in 4.4s
It appears that node 8.0.0 helps babili and butternut performance as well.
Add
uglify
with only themangle
option enabled in the benchmark. Its speed and gzip output size is comparable tobutternut
on average.Timings below with this PR using node 6.9.0 and Butternut version 0.3.5:
Note: Node v7.x has a significant performance regression with the
instanceof
operator that makes uglify twice as slow. Reportedly Node v8.x will fix this issue.