Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

chore(Rakefile): tune JVM for closure compiler

Using the client VM and forcing 32bit mode gives us huge perf boost.


reali   0m8.173s
user    0m39.984s
sys     0m1.408s


real    0m3.000s
user    0m12.687s
sys     0m0.852s
  • Loading branch information...
1 parent c959fa4 commit 3bd95dbb1a502575ae8250f49190f153442054eb @IgorMinar IgorMinar committed
Showing with 4 additions and 1 deletion.
  1. +4 −1 Rakefile
5 Rakefile
@@ -290,7 +290,10 @@ def closure_compile(filename)
min_path = path_to(filename.gsub(/\.js$/, '.min.js'))
- %x(java -jar lib/closure-compiler/compiler.jar \
+ %x(java \
+ -client \
+ -d32 \
+ -jar lib/closure-compiler/compiler.jar \
--compilation_level SIMPLE_OPTIMIZATIONS \
--language_in ECMASCRIPT5_STRICT \
--js #{path_to(filename)} \

2 comments on commit 3bd95db


Interesting result, Igor. One thing -- you're probably using a mac, right? Because -client won't do anything on most 64-bit java distributions (there is physically no -client version of the jvm so on these). I did get a similar result by switching from c2 compiler (used in the server mode) to tiered compilation though (even with 64 bit jvms).



Hey @IgorMinar, thanks for the find!

I tried incorporating this to Grunt Closure Tools but Travis failed with this message:

>> Error: Command failed: Error: This Java instance does not support a 32-bit JVM.
>> Please install the desired version.
>> FAILED to run command for target: testCase

So i had to remove it for now... will include it as an option...

Please sign in to comment.
Something went wrong with that request. Please try again.