Hacker News new | ask | show | jobs
by chubbard 4945 days ago
Rhino has pretty good performance. It's about 1.6x Java's performance which made it pretty darn fast for most scripting languages built on the JVM. I would expect this new project will follow the ScriptEngine API so you could swap out a Rhino interpreter with Nasborn engine. This would make it easy to compare how much the InvokeDynamic instruction can contribute to performance boost. I wonder if it can achieve near Java performance parity.
2 comments

Setting aside what 1.6x means, Rhino is much much slower than V8 or Java. In fact, there's a bit of an elephant in the room here because people don't really care about Nashorn vs. Rhino; they care about Nashorn vs. V8.
My sudoku solver http://dancing-links.herokuapp.com/ in javascript takes roughly a tenth of the time to solve a particular puzzle when running in node/V8 than in Rhino.
There is a big difference between interpreted rhino vs. compile rhino. The Rhino wikipedia page claims compiling to byte code "... produced the best performance, often beating the C implementation of JavaScript run with just-in-time". However, the benchmarks I've seen put Rhino compiled to byte code at about 60% slower than comparable Java code.
What does it mean to be about 1.6x Java's performance? Can you be specific - it doesn't seem to mean much since its implemented on the JVM. Also, I've been using it recently and "dog slow" is how I would describe it.
Roughly performance tests have shown: Java Performance (ms) * 1.6 = Compiled Rhino Performance (ms). So Rhino is about 60% slower than comparable Java code if you compile it to byte code on average.
It means algorithms runs 1.6x faster within Rhino. A JVM implemented in Rhino that runs Rhino within the JS-JVM will run even faster - roughly 2.56x faster.
Wow! So, with an infinite stack of Rhino inside JVM inside Rhine ..... you could get infinite performance! Cool....
It's Rhinos all the way down ...
Which algorithms, what implementations thereof?