Live data from Hacker News

Is Ruby Fast Yet?

isrubyfastyet.com

71–80 of 95 posts

Re: Is Ruby Fast Yet?

#72
post #24
post #8

JRuby question -- Why is it that much slower? I'd have thought that part of the point was to take advantage of the JVM's built in optimization.

My question as well. Every perf benchmark I've seen of jruby over the years, it's much faster than MRI (given time to boot & JIT anyway). I think this guy's numbers are very suspect.

I've benchmarked MRI vs jruby a number of times over the years on real apps and MRI usually cones out faster on average with worse numbers at 95th and 98th percentiles due to GC performance.

I never took the time to figure out why it is faster, but I assume that it is due to C libraries being faster for json serialization and my apps doing primarily json serialization after fetching from the database.

Edit: I should test the performance of the json libs, which would be easy to do

Re: Is Ruby Fast Yet?

#73
We can at least see MRI has gotten faster with each new version, but we knew that already.

Also, I'm a bit surprised that this doesn't include more implementations of Ruby. Where's Rubinius? IronRuby? REE? I hope the list gets updated.

Furthermore, the benchmark itself could be better; I won't say I am disappointed, but I am not too thrilled either.

Re: Is Ruby Fast Yet?

#74

If you're going to call it "Is Ruby Fast Yet", you should really be comparing Ruby implementations to implementations of other programming languages. Asked this way, I believe the answer to the question is a definite "no". As a small example, I benchmarked a real Scala web app running on worse hardware (a 1GB Linux VM) at over 650 requests/s. There was no degradation in load at this rate of requests, but it was 10x t…

Well there is a JRuby and Rubinius comparison. Those are different implementations of the the interpreter. Ruby will never be faster than C, but this site is aiming to show the improvements over time.

Re: Is Ruby Fast Yet?

#75
post #8

JRuby question -- Why is it that much slower? I'd have thought that part of the point was to take advantage of the JVM's built in optimization.

it uses an old hardware, with an old JDK, etc.

Old hardware should not matter, but old JDK is huge.

Re: Is Ruby Fast Yet?

#76

5s startup time for a web framework seems rather high. I wonder how well it compares to similar frameworks in other languages (Django? ASP.NET MVC?)

It does not compare well to other frameworks in Ruby either.

Re: Is Ruby Fast Yet?

#77

Wouldn't it make more sense to test various features of Ruby for comparison rather than comparing an entire web framework? Given that, the URL should be israilsfastyet.com, or more appropriately howdoesrailsbehaveonvariousrubyversions.com

Agreed. This is much more of a test of the rails framework then ruby

Not really since it does not compare it to another other benchmarks. This is a test of how the performance of MRI ruby has changed over time.

Re: Is Ruby Fast Yet?

#78
I've been hacking on a little scripting language of my own lately[1]. To get a handle on its perf, I have a few small benchmarks[2] I run that compare it against Lua (5.1.5), Python (2.7.5), and Ruby (2.0.0p247). (All of those and my language are bytecode-compiled, dynamically typed languages, hence that comparison.)

I happen to have Ruby 2.0 installed, and I was surprised to see it handily beat the other languages. I had expected Ruby to be the slowest of the pack, but they've apparently made big strides in 2.0.

On the off chance that anyone is curious, here's the results of running them on my machine:

    binary_trees - wren   3531  0.28s
    binary_trees - lua    1366  0.73s  258.40%
    binary_trees - python 1420  0.70s  248.64%
    binary_trees - ruby   3170  0.32s  111.39%

    fib - wren            2688  0.37s
    fib - lua             2998  0.33s   89.65%
    fib - python          1390  0.72s  193.38%
    fib - ruby            3645  0.27s   73.74%

    for - wren            9092  0.11s
    for - lua             9387  0.11s   96.86%
    for - python          3171  0.32s  286.74%
    for - ruby            8319  0.12s  109.30%

    method_call - wren    4703  0.21s
    method_call - lua     1780  0.56s  264.20%
    method_call - python   806  1.24s  583.33%
    method_call - ruby    3408  0.29s  138.02%
Those numbers are score, time, and percentage. Score is basically 1/time, just to yield a number where bigger is better. Time is best of ten runs. Percentage is how my language's score compares to that one. So, for example, the 264.20% lua method_call score means my language is about 2.6x faster than Lua on a benchmark designed to stress dynamic method call performance.

[1] https://github.com/munificent/wren [2] https://github.com/munificent/wren/tree/master/benchmark

Re: Is Ruby Fast Yet?

#79

I've been hacking on a little scripting language of my own lately[1]. To get a handle on its perf, I have a few small benchmarks[2] I run that compare it against Lua (5.1.5), Python (2.7.5), and Ruby (2.0.0p247). (All of those and my language are bytecode-compiled, dynamically typed languages, hence that comparison.) I happen to have Ruby 2.0 installed, and I was surprised to see it handily beat the other languages.…

Oh, man, this reminds me of the pain of writing even the most trivial microbenchmarks in seven or eight languages. How about throwing in some of the fast scripting languages for healthy competition? E.g. JavaScript, LuaJIT and Julia. Feel free to borrow (MIT licensed, but I'm willing to relicense whatever I can):

https://github.com/JuliaLang/julia/tree/master/test/perf/mic...

Re: Is Ruby Fast Yet?

#80

I've been hacking on a little scripting language of my own lately[1]. To get a handle on its perf, I have a few small benchmarks[2] I run that compare it against Lua (5.1.5), Python (2.7.5), and Ruby (2.0.0p247). (All of those and my language are bytecode-compiled, dynamically typed languages, hence that comparison.) I happen to have Ruby 2.0 installed, and I was surprised to see it handily beat the other languages.…

I know you were just going with what was already on your system most likely, but wouldn't it be a good idea to compare against a more up to date version of Python (version 3.3.x) and Lua (5.2.x)?

Lua 5.1 initial release was in 2006[1]

Python 2.7 initial release was in 2010[2]

Ruby 2.0 initial release was in 2013[3]

[1] http://www.lua.org/versions.html#5.1

[2] http://en.wikipedia.org/wiki/History_of_Python#Version_relea...

[3] https://www.ruby-lang.org/en/news/2013/02/24/ruby-2-0-0-p0-i...

Post reply on HN