Rhino VS Spidermonkey performance tests
Asked Answered
S

2

6

I have a project I'm working on for my company and right now I need to decide which JS Engine I should use. Currently the choices I have are Spidermonkey or Rhino.

My main concern is performance and scalability, I wanted to know if performance tests to compare the two engines were made?

I found googling this issue harder than I've expected.

Thanks in advance for the help, Ben.

Sergeant answered 30/1, 2012 at 7:51 Comment(2)
I would vote for V8, but it's hard to find a good comparsion. Try to do some basic javascript browser tests. They are more or less reflecting the engine performance.Bugbee
Currently V8 is not an option. I'm searching for perf tests comparing the above engines. Thanks.Sergeant
G
11

I regularly run V8 and Sunspider benchmarks on both Rhino and Spidermonkey (disclaimer: I'm a committer on the Rhino project). The current Rhino release (1.7R3) is still quite a bit slower than Spidermonkey, but recent git snapshots have caught up nicely. (Note that I'm talking about interpreted Spidermonkey without Jaegermonkey or other JITs - Jaegermonkey is way faster.)

On V8-benchmarks-v5 Rhino 1.7R3 scores around 360 on my machine, Rhino git master 480, Rhino git rhino_1_8 branch 570, and a recent Spidermonkey build around 540 (higher is better).

For Sunspider 0.9.1, the numbers are 8890 ms for Rhino 1.7R3, 2250 ms for Rhino master, 2180 ms for rhino_1_8 branch, and 1390 ms for Spidermonkey (this is milliseconds so lower is better).

All Rhino benchmarks are on Oracle JDK 1.7.0 with the server VM and default settings and after a few rounds of warmup. With recent Rhino snapshots you can easily run the benchmarks yourself using the ant benchmark-* targets. My Spidermonkey build is a few months old snapshot built with standard instructions.

Gilstrap answered 30/1, 2012 at 21:15 Comment(1)
Thanks for the detailed information concerning your experience with both. I will definitely take it into consideration. Ben.Sergeant
W
3

I don't know of any benchmarks comparing the two, but in my experience SpiderMonkey has been faster. If performance is the only consideration I'd go with that since V8 isn't an option.

I use Rhino though (actually RingoJS, which is based on Rhino and includes a CommonJS implementation and quite a few useful libraries), since it's fast enough and has (again, in my experience) a more mature set of libraries/frameworks available. It can also interface directly with Java libraries so there's a huge amount of code available.

You also mentioned scalability, and Rhino might actually have an edge there because it has decent support for multithreading. Ringo implements a slightly enhanced web worker API.

I don't know of any multithreading libraries for SpiderMonkey but they may exist.

Watterson answered 30/1, 2012 at 15:23 Comment(1)
I will look into the multithreading issue as it might be what's causing the performance difference when using SpiderMonkey compared against Rhino. Thank you for the answer, Ben.Sergeant

© 2022 - 2024 — McMap. All rights reserved.