Wednesday, June 6, 2012

Ruby is faster than Python, PHP, and Perl

There's a pervasive myth that Ruby is slow, and moreover, that it's the slowest language in popular use. Everyone knows Ruby is slow. Right? Who would possibly disagree that Ruby is slow? Here's an example IRC discussion on freenode's #postgres which happened just yesterday:

16:57 sobel: i can't find it now, but arstechnica benched all the popular dynamic languages
16:58 sobel: using C/C++ as the standard (1.0) they ranked other languages as multiples of C/C++ performance
16:58 sobel: java was a 2
16:58 sobel: twice as slow as C. and it was the winner, head and shoulders above the rest
16:58 sobel: i think Erlang placed somewhat favorably
16:59 sobel: python/perl were near the middle, at something like 25-35x slower than C
16:59 sobel: Ruby: a full 72x slower than C

Ruby loses against invisible Ars Technica benchmarks in the sky with unknown URLs! 72x slower than C! Over twice as slow as Python and Perl!

Fortunately, we don't have to rely on some one-off benchmark Ars Technica may or may not have done at some indeterminate point in time whose URL cannot be located offhand, because there's a site with a fairly decent reputation which provides ongoing benchmarks across multiple programming languages using implementations submitted by fans of said language. It's been around for awhile and is relatively well-trusted.

That site is the Programming Languages Shootout, and unlike the alleged Ars Technica benchmark, you can actually visit their web site at shootout.alioth.debian.org. What do they have to say about programming language performance?


According to this benchmark suite, JRuby is 34.5 times slower than (not C, not C++, but) Fortran. Ruby 1.9 (MRI/YARV) is 43.80 times slower than (not C, not C++, but) Fortran. Both JRuby and Ruby 1.9 beat Python, PHP, and Perl by a considerable margin. The nearest competitor is Python 3, at 47.93 times slower than (not C, not C++, but) Fortran. By the way, did I mention that the fastest language on their benchmark is... not C... not C++, but Fortran? (nothing personal sobel, but unsubstantiated hearsay is bad!)

Yes, that's right folks: according to the Programming Languages Shootout, Python, PHP, and Perl are all slower than Ruby. Did you think Ruby was slower than Python? Guess what, you're wrong. Ruby used to be one of the slowest popular languages, but that has changed. Ruby performance has advanced considerably over the years, so if you're still repeating some offhand information you may or may not have gotten from Ars Technica at some point but can't find the link to as your metric of Ruby performance, you may want to try again, and find modern, relevant information you can actually get a link to.

There are many future VM improvements in the pipe for Ruby, Python, and PHP (and I guess Perl users might continue dreaming of a Parrot-powered Perl 6). Rubyists can look forward to the upcoming JRuby 1.7 release which features InvokeDynamic support and allows for Java-speed method dispatch... in Ruby. InvokeDynamic is a game changer for the JVM in general, and it's a game changer for Ruby, because InvokeDynamic makes JRuby dispatch potentially as fast as Java.

Python users can look forward to PyPy, which is posting some incredibly impressive numbers, especially around numerical computing. Python users can also look forward to resumed work on Jython, which is adding InvokeDynamic support which can potentially make Python as fast as Java. Finally, PHP users can look forward to the HipHop VM developed at Facebook, which will provide much improved performance for PHP. These are all great projects, but none of them are really ready for general consumption yet (including JRuby 1.7).

All that said, the Programming Language Shootout doesn't include any of these unreleased development versions in the benchmarks you see when you visit their site. They show the numbers for the latest production releases, and those numbers show Ruby is faster than Python, PHP, and Perl.

The game has changed: you just weren't paying attention.

Last but not least, if you've seen some benchmark somewhere, even if you have an eidetic memory and remember but the numbers were, but can't even dredge up a link to it, please, please, don't quote said benchmark, even if you have an eidetic memory and remember what the numbers were.

For benchmarks to be remotely scientific, they must be both reproducible and falsifiable, and hopefully in addition to both those things they have a good methodology. If you can't even dredge up a link to the benchmark in question, please don't go quoting numbers off the top of your head to people who might be influenced by them.

Let's advance computer science beyond the state of witch doctors telling people to bleed themselves with leeches because at some point someone said they might make you feel better maybe.

845 comments:

«Oldest   ‹Older   801 – 845 of 845
Smmvilla said...

Thanks for sharing your thoughts. I truly appreciate your efforts and I will be waiting
for your next post thank you once again. Buy Instagram followers

HOT AND SEXY INDEPENDENT ESCORTS IN LUCKNOW said...

THANK YOU FOR VISITING MY WEBSITE:-
russian escorts in gurgaon
housewife escorts in gurgaon
gurgaon escort services
gurgaon escorts
escorts in gurgaon
escort services in gurgaon
gurgaon call girls
call girls in gurgaon

un known said...

Thanks for Sharing This Article.It is very so much valuable content. I hope these Commenting lists will help to my website
devops online training
best angularjs online training
top angularjs online training

james jobs said...

Emirates means comfort but their prices gave me chills. Not anymore, thanks to Emirates Airlines Phone Number I can book my flight tickets at a low cost. They always offer great deals.


james jobs said...

Finding comfort and budget-friendly tickets are not so difficult with American Airlines Customer Service. From one-way to group booking, they always offer great deals.

james jobs said...


Why flights have to be expensive’, I always wondered whenever I had to cancel a plan. But, after I found United Phone Number, I don’t have to worry about airfare, thanks to its deals.

james jobs said...


I love flying in the comfort that’s why I love Lufthansa. But, their airfares always affect my pockets. I’m glad I found the Lufthansa Airlines Phone Number, they always give me great discounts.

james jobs said...

If you’re looking for the best deals and round-the-clock intact expert support, Southwest Airlines Customer Service is a reliable platform for you. It’s a great help especially for solo travelers and first-time travelers.

jacksonparkar said...

Sun Country Airlines Number is available 24*7 to help you with customer service related queries. Call now Sun Country Airlines Number.

jacksonparkar said...

Book flights United Airlines at very affordable price guarantee, We provide Instant Services regarding United Airlines Fare Calendar flights tickets.

jacksonparkar said...

Find perfect deals on Allegiant Airlines Flights and get reliable info related to the certain policies with help of Allegiant Airlines Phone Number.

nituroy.com said...

Thanks for sharing the article...You write very well...If you need backlinks please reach me on genuinehotelescorts@gmail.com
Call girls in jaipur
Call girls in Jaipur
Call girls in Jaipur
Call girls in Delhi
Call girls in Guwahati
Call girls in Guwahati
Call girls in Guwahati
Call girls in Guwahati
Call girls in Aerocity

Cash App Support said...

After reading the blog I can confidently say that I consumed very much Knowledge.
Hi, My name is Bryan & I am a senior Printer Technician at Brother Printer.
I also recently wrote a blog. You can read that here:
Click Here
Click Here
Click Here
Click Here
Click Here
Click Here

Cash App Support said...

I not a casual commentator but this valuable blog forced me to comment. I fell in love with the way you write. Wish you very good luck for the future. Hope you will continue producing this level knowledgeable blog. Much love may god bless you.
Click Here
Click Here
Click Here
Click Here
Click Here

Cash App Support said...

This blog helped me alot, I shared it on all my social media . Sending you virtual hugs from bottom of heart..
Click Here
Click Here
Click Here
Click Here
Click Here

Cash App Support said...

Interesting stuff to read. Keep it up.
This blog is great to check it out:
Click Here
Click Here
Click Here
Click Here
Click Here

Cash App Support said...

Really very happy to say, your post is very interesting to read. I never stop myself to say something about it. You’re doing a great job. Keep it up.
look inside
look inside
look inside
look inside
look inside

Cash App Support said...

This blog helped me alot, I shared it on all my social media . Sending you virtual hugs from bottom of heart...
look inside
look inside
look inside
look inside
look inside
look inside
Thanks for sharing the valuable information. It is my pleasure that I consumed your content and invested my time in it.

robin.smithsters said...

TestBanksOnline is the best website to Buy Test Banks Online. Great study materials like Guiding Childrens Social Development And Learning 8th Edition Test Bank are available with instant download and best discounts. Search 4000+ test banks and solution manuals online.

seema said...


best massage parlour delhi
cross gender massage in delhi
full body massage prices
spa in hauz khas
massaging body spa
Delhi spa video Full Body to body b2b Female to male spa sandwich massage in Delhi green park
Best spa body to body south Delhi
Total Relax spa green park
Best spa
body to body massage in delhi

seema said...


massagers in delhi
complete body massager price
sandwich massage price in delhi
massage near me prices
near body massage spa
spa by female to male in delhi
massage with extra service
b2b near me
body massage in delhi airport
body massage connaught place delhi

seema said...


cross body massage
thai sandwich spa
full body spa near me
indian massage centre
body massage offer near me
massage centres in paharganj delhi
male to male massage delhi
best massage centre in delhi
bangkok full body massage price
couple massage spa in delhi

seema said...


service massage in delhi
near massage center
body to boby massage
best spa with extra service in delhi
body massage at delhi
indian massage parlour
body massage near me with price list
sandwich massage therapy in delhi
spa massage full body
full body massage south delhi

seema said...


american body massage
male to female spa near me
green park massage
body massage service at home near me
massage service in delhi
best body to body spa in delhi
massage parlor in delhi
body massage in green park delhi
massage parlour in south delhi
full body oil massage in delhi

seema said...


russian spa near me
russian spa delhi
Nuru massage in delhi
spa with full service
south delhi spa
full body massage in delhi price
body massage in delhi near me
full body massage delhi
sandwich massage in delhi
body massage in green park

seema said...


spa near me with extra service
b2b spa
spa in delhi with extra service
b2b spa in delhi
delhi massage spa
full service spa near me
spa in delhi with price
spa extra service
desi massage parlour
massage spa delhi

Indian Truthlogy said...

I liked nothing in your blog strucure and I didn`t even read your content also. Hope you served valueable and good content. I will not comment ever here, but i have to index my backlinks thats why I am doing this shit. God bless you and are your website.
link
link
link
link
link

Indian Truthlogy said...

Can you please explain me this in brief, Righly recommended great blog! Very honest and practical.I really enjoyed this post.Nice post!! these tips may help.
link
link
link
link
link

Indian Truthlogy said...

I am amazed by the way you have explained things in this article. This article is quite interesting and I am looking forward to reading more of your posts. Thanks for sharing this article with us.
link
link
link
link
link

Indian Truthlogy said...

Interesting stuff to read. Keep it up.
This blog is great to check it out:
link
link
link
link
link

Indian Truthlogy said...

Really very happy to say, your post is very interesting to read. I never stop myself to say something about it. You’re doing a great job. Keep it up.
link
link
link
link

Indian Truthlogy said...

This is great advice! Very honest and practical.I really enjoyed this post.Nice post!! these tips may help.
link
link
link
link
link
link
link

Indian Truthlogy said...

Perfectly Described. Highly recommended blog
4086229003
4086229003
4086229003
4086229003
4086229003

Indian Truthlogy said...

I not a casual commentator but this informative blog forced me to comment.
I fell in love with the way you write. best wishes for the future.
Hope you will continue producing this level knowledgeable blog.
Much love may god bless your skills.
I also recently wrote a blog. You can read that here:
4085209013
4085209013
4085209013
4085209013
4085209013

Cash App Support said...


This is great advice! Very honest and practical.I really enjoyed this post.Nice post!! these tips may help.
click to open
click to open
click to open
click to open
click to open

Cash App Support said...

I am really happy to say it’s an interesting post to read.
I learn new information from your article, you are doing a great job. Keep it up.
click to open
click to open
click to open
click to open
click to open

Cash App Support said...

Really very happy to say, your post is very interesting to read. I never stop myself to say something about it.
You’re doing a great job. Keep it up.
click to open
click to open
click to open
click to open
click to open
click to open

Cash App Support said...

very interesting, good job, and thanks for sharing such a good blog.
click to open
click to open
click to open
click to open
click to open

Cash App Support said...

Impressive!Thanks for the post
very nice… I really like your blog…
click to open
click to open
click to open
click to open
click to open

Cash App Support said...

I not a casual commentator but this valuable blog forced me to comment.
I fell in love with the way you write. Wish you very good luck for the future.
Hope you will continue producing this level knowledgeable blog. Much love may god bless you.
click to open
click to open
click to open
click to open
click to open

Cash App Support said...

I not a casual commentator but this valuable blog forced me to comment.
I fell in love with the way you write. Wish you very good luck for the future.
Hope you will continue producing this level knowledgeable blog. Much love may god bless you.
click to open
click to open
click to open
click to open
click to open

Cash App Support said...

After reading the blog I can confidently say that I consumed very much Knowledge.
Hi, My name is Bryan & I am a senior Printer Technician at Brother Printer.
I also recently wrote a blog. You can read that here:
click to open
click to open
click to open
click to open
click to open


Paypal Fraud Protection said...

Paypal is the most trustable payment method worldwide.
Call :- 4085209013
4085209013

meritstep said...

I just loved your article on the beginners guide to starting a blog.If somebody take this blog article seriously
in their life, he/she can earn his living by doing blogging.Thank you for this article.
tibco sportfire online training

meritstep said...

I just loved your article on the beginners guide to starting a blog.If somebody take this blog article seriously
in their life, he/she can earn his living by doing blogging.Thank you for this article.
java online training

«Oldest ‹Older   801 – 845 of 845   Newer› Newest»