Rhino performance

179 views
Skip to first unread message

Brian Moschel

unread,
Mar 2, 2011, 4:06:13 PM3/2/11
to UglifyJS
Hey guys,

I am a JavaScriptMVC developer. I was attempting today to add
UglifyJS support for our build system. We use Rhino everywhere
(partly because it runs on Java, so it provides easy Windows/non
Windows support, unlike Node), so I wanted to try to run Uglify in
Rhino.

I got Uglify working from Rhino. But I noticed some terrible
performance. Compressing jQuery takes 73 seconds. Small scripts are
very fast (less than .1 seconds) but large ones take forever. I
thought maybe it was because I was using aggressive optimizations, but
even the parsing step takes 20 seconds+.

I'm running this on Windows. Any idea why? Or has anyone tried this
in Rhino before? The website claims 1 sec compress time for
jquery.js, so its hard to believe that Node vs. Rhino makes up all
that difference, but maybe thats it.

- Brian Moschel

Brian Moschel

unread,
Mar 2, 2011, 5:50:30 PM3/2/11
to UglifyJS
I was actually able to verify this with requireJS.  Using node, jquery compresses in about a second.  Using Rhino, it takes between 40 seconds and a minute.

This is too bad, as node is very difficult to install, let alone package.  I wish node were easier to package like Rhino is.  Does anyone know any way around this?  Otherwise we can't use Uglify.
--
Brian Moschel

Jupiter Consulting
\Development\Training\Support
847-727-1609
brian....@gmail.com

Alex Objelean

unread,
Mar 6, 2011, 11:26:36 AM3/6/11
to ugli...@googlegroups.com
On my laptop (not very performant one) I was able to compress jquery with uglifyJs using Rhino in about 23 seconds. You can use wro4j-runner to check how much time would it take for you to do the same on your computer. It is a command line utility. Using this tool you can easily switch from one of several available compressors like: uglifyJs, googleClosure, YuiCompressor, jsMin, packerJs and dojoShrinksafe.

I would be curious to see how much time does it take to compress jquery on your machine with uglifyJs compressor.

Cheers,
Alex

Mihai Călin Bazon

unread,
Mar 6, 2011, 12:25:31 PM3/6/11
to ugli...@googlegroups.com
Wow, I knew Rhino is slow but I didn't think it's *that* slow!...  Sorry, not much I can do about it.  Even in a browser it should run a lot faster.

Cheers,
-Mihai
--
Mihai Bazon,
http://mihai.bazon.net/blog

Piotr Rochala

unread,
Feb 11, 2013, 12:22:51 AM2/11/13
to ugli...@googlegroups.com
FYI

It takes 3 minutes to compile my JavaScript code base on Rhino. I'm using require.js as dependency management framework and uglify as my minifier.

Same task takes 30s on Node.

So yes, Rhino definitely has some performance issues...
Reply all
Reply to author
Forward
0 new messages