JRuby is Fast!

Following up on my previous blog post about Fibonacci numbers and prime-number tests using Python and Ruby (click to read), I thought I’d give the same code a bit of whirl on my new laptop, and throw in the latest 1.6.0 release of JRuby in the mix.

The results:

Fibonacci numbers (40th)

Python 2.7.1 = 106.4s
Ruby 1.9.2 = 44.2s
JRuby 1.6.0 = 30.6s

Prime test (9000000000059)

Python 2.7.1 = 1.33s
Ruby 1.9.2 = 1.74s
JRuby 1.6.0 = 0.68s

JRuby is – performance wise, at least – a truly impressive piece of work! I thought its speed would be comparable to MRI/YARV, but nope, it goes beyond. Well done to the JRuby team. :)

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.