Created
December 17, 2010 00:14
-
-
Save juliocesar/744259 to your computer and use it in GitHub Desktop.
closure-compiler compiling an empty method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> require 'closure-compiler' | |
=> true | |
>> require 'benchmark' | |
=> true | |
>> puts Benchmark.measure { Closure::Compiler.new.compile 'function foo() {}' } | |
0.000000 0.010000 2.600000 ( 1.571835) | |
=> nil | |
>> puts Benchmark.measure { Closure::Compiler.new.compile 'function foo() {}' } | |
0.000000 0.000000 2.630000 ( 1.624686) | |
=> nil | |
^ 2.6 seconds to compress that. Seriously? | |
For the record, I understand that's the time it takes to | |
call out to Java to execute the .jar file. Still, for what | |
I'm building, it's an awful lot expensive. | |
EDIT: Solution so far → https://github.com/rgrove/jsmin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment