Replace closure-compiler with a faster minifier #693

Open
timabbott opened this Issue Apr 22, 2016 · 0 comments

Projects

None yet

1 participant

@timabbott
Member

It's really slow, which in turn makes tools/build-release-tarball slow, and slows the feedback cycle for any machines doing deployments off of CI.

@timabbott timabbott added this to the 2016 roadmap milestone Apr 29, 2016
@timabbott timabbott modified the milestone: Zulip roadmap, Old roadmap Nov 18, 2016
@tommyip tommyip added a commit to tommyip/zulip that referenced this issue Dec 26, 2016
@tommyip tommyip [POC] Replace Closure compiler with UglifyJS 2.
Uglify-js is a node minifier, it could minify our javascript code
base much faster than the closure compiler with the output files
being only slightly larger. It requires less memory and CPU resources
as well.

Fixes #693.
a269ebc
@tommyip tommyip added a commit to tommyip/zulip that referenced this issue Dec 26, 2016
@tommyip tommyip [POC] Replace Closure compiler with UglifyJS 2.
Benchmark on my local machine:

Minifier | Time     | Size
---------|----------|--------
Closure  | 30.6 sec | 1012kb
UglifyJS | 11.3 sec | 1008kb

Time -> Time to run tools/minify-js
Size -> Size of static/min

Result:
271% speed improvement
3.97% reduction in size

There are some optimization options avaliable in UglifyJS, but may
increase run time slightly.

Fixes #693.
13b5634
@tommyip tommyip added a commit to tommyip/zulip that referenced this issue Dec 26, 2016
@tommyip tommyip Replace Closure compiler with UglifyJS 2.
Benchmark on my local machine:

Minifier | Time     | Size
---------|----------|--------
Closure  | 30.6 sec | 1012kb
UglifyJS | 11.3 sec | 1008kb

Time -> Time to run tools/minify-js
Size -> Size of static/min

Result:
271% speed improvement
3.97% reduction in size

Most optimizations are on by default and can be disabled to further
decrease the time spend minifying the code base.

Fixes #693.
f4e66de
@tommyip tommyip added a commit to tommyip/zulip that referenced this issue Dec 27, 2016
@tommyip tommyip Replace Closure Compiler with UglifyJS 2.
Benchmark on my local machine:

Minifier | Time     | Size
---------|----------|--------
Closure  | 30.6 sec | 1012kb
UglifyJS | 11.3 sec | 1008kb

Time - Time to run tools/minify-js
Size - Size of static/min

Result:
- 271% speed improvement

The settings of UglifyJS can be set in prod_settings_template.py

Fixes #693.
ef3f6e1
@tommyip tommyip added a commit to tommyip/zulip that referenced this issue Dec 28, 2016
@tommyip tommyip Replace Closure Compiler with UglifyJS 2.
Benchmark on my local machine:

Minifier | Time     | Size
---------|----------|--------
Closure  | 30.6 sec | 1012kb
UglifyJS | 11.3 sec | 1008kb

Time - Time to run tools/minify-js
Size - Size of static/min

Result:
- 271% speed improvement

The settings of UglifyJS can be set in zproject/settings.py.

Fixes #693.
368982e
@tommyip tommyip added a commit to tommyip/zulip that referenced this issue Dec 31, 2016
@tommyip tommyip Replace Closure Compiler with UglifyJS 2.
Replacing the slow Java Closure Compiler by UglifyJS 2.

Benchmark (local machine):

| Minifier | Time (sec) | Size (KB) |
| -------- | ---------- | --------- |
| Closure  |       54.9 |      2980 |
| UglifyJS |       27.2 |      2996 |

* Time: `time tools/minify-js`
* Size: `du -k static/min`

All safe optimizations for UglifyJS 2 are enabled by default and
can be disabled to reduce run time.

Fixes #693.
736778a
@timabbott timabbott added a commit to timabbott/zulip that referenced this issue Jan 6, 2017
@tommyip @timabbott tommyip + timabbott Replace Closure Compiler with UglifyJS 2.
Replacing the slow Java Closure Compiler by UglifyJS 2.

Benchmark (local machine):

| Minifier | Time (sec) | Size (KB) |
| -------- | ---------- | --------- |
| Closure  |       54.9 |      2980 |
| UglifyJS |       27.2 |      2996 |

* Time: `time tools/minify-js`
* Size: `du -k static/min`

All safe optimizations for UglifyJS 2 are enabled by default and
can be disabled to reduce run time.

Fixes #693.
2e29a78
@tommyip tommyip added a commit to tommyip/zulip that referenced this issue Jan 11, 2017
@tommyip tommyip Replace Closure Compiler with UglifyJS 2.
Replacing the slow Java Closure Compiler by UglifyJS 2.

Benchmark (local machine):

| Minifier | Time (sec) | Size (KB) |
| -------- | ---------- | --------- |
| Closure  |       54.9 |      2980 |
| UglifyJS |       27.2 |      2996 |

* Time: `time tools/minify-js`
* Size: `du -k static/min`

All safe optimizations for UglifyJS 2 are enabled by default and
can be disabled to reduce run time.

Fixes #693.
99591c9
@tommyip tommyip added a commit to tommyip/zulip that referenced this issue Jan 11, 2017
@tommyip tommyip Replace Closure Compiler with UglifyJS 2.
Replacing the slow Java Closure Compiler by UglifyJS 2.

Benchmark (local machine):

| Minifier | Time (sec) | Size (KB) |
| -------- | ---------- | --------- |
| Closure  |       54.9 |      2980 |
| UglifyJS |       27.2 |      2996 |

* Time: `time tools/minify-js`
* Size: `du -k static/min`

All safe optimizations for UglifyJS 2 are enabled by default and
can be disabled to reduce run time.

Fixes #693.
7491787
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment