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.

226 comments:

«Oldest   ‹Older   201 – 226 of 226
Kamlesh Tyagi said...

Technical support may be delivered by the different technologies depending on the situation. For example, direct questions can be addressed using telephone calls, SMS, Online chat, Support Forums, E-mail or Fax.
Windows support number

Mohan Brij said...

Norton Customer Support

chrome support said...

thanks for sharing.
chrome customer service

Gmail Support said...

This blog shares some good quality information which is very useful for my project work. Thanks for sharing all this precious information with us. I would like to read out some more posts from you.
Gmail Customer Care

Admin said...

Komik Hentai || Komik SEX || Naruto Hentai || hentai || komik hentai naruto || komik Naruto Hentai || Komik bokep || Komik bokep || komik dewasa

hookupapps said...

chrome support services provide services that help to resolve your mail related problem.
Chrome Contact Number

Maria Kenlis said...

Thanks for deliver this awesome post with us, Mobile number tracker with current location

Amir kh said...

دانلود Root Booster FULL 2.2.2.28 برنامه افزایش کارایی گوشی اندروید
دانلود یاهو مسنجر Yahoo! Messenger v1.8.8 برای اندروید
10 مکان باورنکردنی در جهان

Tech Support said...

Want to know Windows 7 Product Key 2017 but don’t know how? Contact us Windows 7 Product Key 2017 We will help you to solve your problems.

Jhon said...

komik hentai || komik sex || komik bokep || komik dewasa

The Purple Orchid Massage and Spa said...

Hi,

Thanks for sharing very interesting posting.

Body Massage Centre in Bangalore

Massage Centre in Bangalore

Purple Orchid Massage and Spa

From,
Prabhu.

Anosh Alassi said...

شركة تركيب مكيفات اسبلت بالرياض
شركة تنظيف مكيفات اسبلت بالرياض
شركة صيانة مكيفات اسبلت بالرياض
شركة مكافحة حمام بالرياض
شركة عزل فوم بالرياض

Zam Iub said...

windowblinds crack
well written and nice stuff

The Purple Orchid Massage and Spa said...

Hi,

Thanks for sharing a very interesting article about Ruby is faster than Python, PHP, and Perl. This is very useful information for online blog review readers.

From,
Prabhu,
Body Massage Centre in Bangalore

BOKEP HIPERSEX said...

bokep hentai

bokep jepang

streaming bokep


malam senin bokep


bokep indo terbaru 2018

komik hentai

bokep streaming barat

bokepindo 2018

shina said...

cctv camera for home
Pestveda | Pest Control
Termite control

Maria Kenlis said...

thanks for posting WiFi Password Hacking Software

گلنار جودی said...

هر کدام از این روش‌های جراحی چاقی خطرات و عوارض مربوط به خود مانند احتمال عفونت، فتق و لخته شدن خون را دارند و ممکن است فرد را مجبور به پیگیری‌های مداوم کنند، اما نتایج حاصل از آن‌ها و میزان موفقیت‌ شان در درمان چاقی فرد را علی‌رغم مشکلات احتمالی جذب خواهند کرد.
با این حال نتایج حاصل از جراحی چاقی نیز به شرطی می‌تواند پایدار بماند که فرد تغییرات چشمگیر و دائمی در سبک زندگی خود ایجاد کند.

گلنار جودی said...

تبلیغات در تلگرام به دو روش تبلیغات کلیکی و تبلیغات بازدیدی در کانال های تلگرام نمایش داده می شود. در تبلیغات گسترده در تلگرام ، شما تنها زمانی هزینه می پردازید که یک کاربر واقعی و غیر تکراری بر روی لینک تبلیغ شما کلیک کند. در تبلیغات بازدیدی تلگرام ، تبلیغ شما در کانال های پر مخاطب تلگرام نمایش داده می شود و هزینه تبلیغات بر اساس تعداد بازدیدهای پست تبلیغاتی شما محاسبه خواهد شد.

گلنار جودی said...

با خرید گل و سفارش دسته گل, سفارش گل , خرید جعبه گل از قاصدک گل های زیبا و باکیفیت را می توانید از گل فروشی ما سفارش بدهید. ما آماده ارائه انواع گل ها با قیمت مناسب برای مناسبت ها و جشن های شما هستیم. خرید گل و سفارش دسته گل و سفارش جعبه گل از طریق سایت آنلاین گل فروشی ما یکی از بهترین و آسان ترین راه ها برای خرید گل
است. پس از سال ها فعالیت در زمینه گل فروشی به فکر آن افتادیم تا کار خود را در فضای مجازی نیز دنبال کنیم و تاکنون با راه اندازی سایت گل فروشی توانسته ایم رضایت مشتری های خود را در سایت نیز به دست بیاوریم.

گلنار جودی said...

تعمیرگاه مجاز ال جی و نمایندگی مجاز ال جی تعمیرات لوازم خانگی ال جی (LG) در ایران دارای سابقه و رزومه کار و فعالیت می باشد و در عرصه تعمیرات لوازم خانگی و... نیروی مجرب و با تجربه ای را به همراه دارد که می تواند باعث آسودگی خاطر شما عزیزان برای سپردن محصولات تان به شرکت ما شود.

گلنار جودی said...

شرکت ما نیز با دارا بودن مجوز
تعمیرگاه مجاز سامسونگ و پروانه کسب از اتحادیه مرتبط و با کاردان هایی با تجربه و آموزش دیده آماده عرضه هرگونه خدمات و تعمیر و نگهداری انواع کالاهای لوازم خانگی برند سامسونگ هستند.

neelam farooqi said...

Nice blog with good information
Yify

lija outlaw said...

cctv camera for home
Pestveda | Pest Control
Termite control
Surveillancekart | CCTV System
cctv installation services
best home security camera system

Indra Dhawa said...

Get instant help for all types of Canon devices.
Canon Support

shina said...

security system in delhi
cctv camera dealers in delhi
cp plus cctv camera online
hikvision camera online
cctv camera installation services in delhi
cctv camera installation services in gurugram

«Oldest ‹Older   201 – 226 of 226   Newer› Newest»