'. '

RubySpeed

From APIDesign

(Difference between revisions)
Jump to: navigation, search
(New page: Ruby was always known to be very slow language. Even when the hype around Rails was on - e.g. around 2006, there was nobody who could make the language fast...)
Line 5: Line 5:
{{#ev:youtube|ufShKmS5Ueo}}
{{#ev:youtube|ufShKmS5Ueo}}
 +
Is [[Truffle]] based [[Ruby]] ten times faster? [https://youtu.be/ufShKmS5Ueo The video] shows that standard [[Ruby]] can compute about 5000 of prime numbers in 20s on my computer. The [[Truffle]] version was able to compute 17000 of primes. For a while I believed that this implies three times speed up. Not bad, but far less than the claim of being ten times faster.
 +
 +
However once, while showing the demo, [[I]] forgot to kill the standard [[Ruby]] version. After three minutes [[I]] noticed that and to my surprise the standard version was still fighting with 15000th prime number - e.g. it takes at least 180s to compute what [[Truffle]] [[Ruby]] can in 20s. And that actually means ten times speed up!
 +
 +
[[Truffle]] gives [[Ruby]] the speed it always needed.
[[Category:Video]]
[[Category:Video]]

Revision as of 12:02, 2 October 2015

Ruby was always known to be very slow language. Even when the hype around Rails was on - e.g. around 2006, there was nobody who could make the language fast. The great news is that OracleLabs decided to demonstrate the power of their Truffle framework on Ruby and are working on a fast Ruby implementation. OracleLabs claim that their implementation is ten times faster than the standard Ruby.

I wanted to verify such claim. One thing is being faster in a benchmark, the other thing is to speed up real programs. That is why I decided to write my first Ruby program - the sieve of Eratosthenes and as following video demonstrates, Truffle based Ruby is really faster:

Is Truffle based Ruby ten times faster? The video shows that standard Ruby can compute about 5000 of prime numbers in 20s on my computer. The Truffle version was able to compute 17000 of primes. For a while I believed that this implies three times speed up. Not bad, but far less than the claim of being ten times faster.

However once, while showing the demo, I forgot to kill the standard Ruby version. After three minutes I noticed that and to my surprise the standard version was still fighting with 15000th prime number - e.g. it takes at least 180s to compute what Truffle Ruby can in 20s. And that actually means ten times speed up!

Truffle gives Ruby the speed it always needed.

Personal tools
buy