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.

414 comments:

«Oldest   ‹Older   401 – 414 of 414
Flipkart CashBack Offers Flipkart CashBack Offers said...

hi nice website .good information iam daily following your website.

Flipkart CashBack Offers - SBI, HDFC, ICICI, Citibank Cards,flipkart sbi debit card emi,flipkart upcoming offers on mobiles,snapdeal credit card offers,flipkart credit card,flipkart cashback phonepe,flipkart credit card generator,flipkart cashback offer phonepe,flipkart american express,india fake debit card generator,flipkart pockets offer,flipkart bank offers 2018,flipkart american express gift card,sbi credit card offers on flipkart today,sbi flipkart offer,sbi debit card offers cash back,sbi flipkart offer 2018,Flipkart Cashback Offers || Flipkart Bank Offers || Flipkart Deals 2018 ||


cashback offers coupons,
cashback offers coupons


Offers.Flipkart .
flipkart bank offers,flipkart cash back coupons, flipkart offers,flipkart cashback offers ,flipkart cashback offers,flipkart cash back offers,flipkart cashback coupons,flipkart cashback,Flipkart Cashback Offers,Flipkart Bank Offers, flipkart upcoming offers on mobiles, flipkart hdfc offer, flipkart icici offer,sbi credit card offers on flipkart today,sbi flipkart offer, hdfc credit card offers on flipkart, flipkart upcoming offers on mobiles, flipkart offers


amazon Cashback Offers 2018 Upto 65% Cashback Deals, AMAZON CASHBACK
OFFERS 2018, DISCOUNT COUPON OFFERS 2018, Amazon cashback offers with sbi hdfc icici axis banks credit&debit card offers more. amazon cashback offers2018,amazon india cashback,amazon offers on mobiles,amazon cashback2018,amazon offers 2018


"cash back coupons "Coupons, Discounts & Offers on 1500+ Shopping Sites in
India. Get Extra Cashback Everytime You Shop Online using Coupons of Amazon, Flipkart, Tata CLiQ, Nykaa etc."cashback, vouchers, coupons, discounts, offers, deals, promo codes,Coupons, Promo Codes & Cashback Offers



"Flipkart Cashback Offers || Flipkart Bank Offers || Flipkart Deals 2018 ||" "flipkart upcoming offers on mobiles, hdfc credit card offers on flipkart 2018, sbi credit card offers on flipkart today, flipkart hdfc offer terms and conditions, sbi flipkart offer 2018, flipkart cashback phonepe, flipkart hdfc offer august 2018, flipkart icici offers

Flipkart CashBack Offers Flipkart CashBack Offers said...



Musafir, My Bus Tickets, Myles, Orbitz, Qatar Airways, Rehlat, Sixt Car Rental, Skyscanner, SOTC Holidays, Starline Tours, Thomas Cook, Ticket Goose, Travelguru, Travel Talk Tours, Treebohotels

,Credit card offers in jabong,jabong hdfc Cashback,jabong icici cashback,jabong sbi cashback,
Jabong Cashback Offers & Discount Coupons 2018 : Extra 20% Offer,jabong coupons, jabong offers, hdfc jabong offer, icici jabong offer 2018, jabong footwear, sbi jabong offer, jabong axis bank offer, jabong sbi offer 2018,jabong cashback Offers, jabong cashback, jabong Deals,Credit card offers in jabong,jabong hdfc Cashback,jabong icici cashback,jabong sbi cashback ,jabong axis cashback,jabong offers,Jabong cashback coupons,jabong offers


Online Sale - Online Sale Shopping of up to 70% Of...
zivame cash back offers
Jabong Bank Coupons April 2018 for ICICI, SBI, HDF...
Ferns N Petals
Amazon today's deals great saving every day
Up to 40% off TVs & Appliances + Additional 10% cashback offers


amazon cashback offers,Amazon Cashback Offers May 2018 Upto 65% Cashback Deals,Amazon cashback offers January,Amazon cashback offers February,amazon cashback march,Amazon offers april , Cashback offers may , August cashback amazon , September offers cashback November , Cashback offers on December , HDFC Credit card offers on amazon,Axis Bank credit card offer on amazon,ICICI bank offers in amazon,Citi bank cashback on amazon

Amazon cashback offers January , Amazon cashback offers February , amazon cashback march , Amazon offers april , Cashback offers may , August cashback amazon , September offers cashback November , Cashback offers on December , HDFC Credit card offers on amazon , Axis Bank credit card offer on amazon , ICICI bank offers in amazon , Citi bank cashback on amazon

make my trip citi credit and debit cards offers:- ...
make my trip International hotel jaw -dropping dea...
make my trip first night free on 1st hotel booking...
Hurry! Get exciting discounts on Hotels & Flights ...
akbartravels save big upto 1000 off on flight book...
Exclusive offer: Get 15% OFF on HOTELS with Visa f...
Exclusive offer: Get 15% OFF on HOTELS with Visa ...
(10 may 18) : TRAVELSPICE 5 Star Hotels at 3 Star ...
Travelspice - 10 may 18 cashback offers
maake my trip anniversary trvel sale best deal int...
Makemytrip International Flights latest deals on ...
TopTravel Websites cashback offers &discounts upto


"Cashback Offers Coupons Offers you dozens of Cashback offers with your Credit / debit / Net banking for Top eCommerce,cash back offers coupons

Ferns N Petals ,ferns and petals login, ferns and ...
shopclues paytm offer, shopclues 25 off coupon, sh...
myntra coupons, myntra cashback paytm, myntra hdfc...
Jabong Cashback - Jabong Offers, Cashback & Coupons,Cashback Coupons : CashBack Offers, Discount Coupons & Promo


Ajio 40% off on 2990
All shopping websites DISCOUNTS upto 80% offers HERE
flipkart baby toys min 40% off
flipkart Featured Deals
Snapdeal cashback offers on Electronics upto 65% off on mobiles and accessories

Full Version Software said...

Paragon Hard Disk Manager Crack
So amazing and well article thanks for sharing

احمد مديو said...

صيانة سيمنس

شركة صيانة سيمنس هي شركة متخصصة في صيانة سيمنس بجميع أنواعها معروفة بتقديمها لخدمات في منتهى الجودة والدقة تسعى من خلالها للوصول إلى العالمية فإذا كنتم بحاجة لعمل صيانة سيمنس
يمكنكم الاعتماد على شركتنا التي تقوم بجميع أعمال إصلاح وتنظيف وفك وتركيب جميع أنواع صيانة سيمنس بكل إتقان فنحن نمتلك جميع الإمكانيات التي تساعدنا على منح عملائنا الكرام خدمات ذات مستوى عالي من الجودة فلا تتردوا في التواصل معنا لتستفيدوا من خدماتنا وأسعارنا المتميزة فنحن نعمل جاهدين لإرضائكم وكسب ثقتكم وهذا ما يجعلنا في سعي متواصل لتحسين وتطوير خدماتنا
https://samsung.khaterr.com
https://lg.khaterr.com
https://elarabygroup.khaterr.com
https://bosch.khaterr.com
https://daewoo.khaterr.com
http://ariston.khaterr.com
https://ara4host.com
https://siemens.khaterr.com

احمد مديو said...

صيانة سيمنس

شركة صيانة سيمنس هي شركة متخصصة في صيانة سيمنس بجميع أنواعها معروفة بتقديمها لخدمات في منتهى الجودة والدقة تسعى من خلالها للوصول إلى العالمية فإذا كنتم بحاجة لعمل صيانة سيمنس
يمكنكم الاعتماد على شركتنا التي تقوم بجميع أعمال إصلاح وتنظيف وفك وتركيب جميع أنواع صيانة سيمنس بكل إتقان فنحن نمتلك جميع الإمكانيات التي تساعدنا على منح عملائنا الكرام خدمات ذات مستوى عالي من الجودة فلا تتردوا في التواصل معنا لتستفيدوا من خدماتنا وأسعارنا المتميزة فنحن نعمل جاهدين لإرضائكم وكسب ثقتكم وهذا ما يجعلنا في سعي متواصل لتحسين وتطوير خدماتنا
https://samsung.khaterr.com
https://lg.khaterr.com
https://elarabygroup.khaterr.com
https://bosch.khaterr.com
https://daewoo.khaterr.com
http://ariston.khaterr.com
https://ara4host.com
https://siemens.khaterr.com

احمد مديو said...

شركة صيانة سيمنس هي شركة متخصصة في صيانة سيمنس بجميع أنواعها معروفة بتقديمها لخدمات في منتهى الجودة والدقة تسعى من خلالها للوصول إلى العالمية فإذا كنتم بحاجة لعمل صيانة سيمنس
يمكنكم الاعتماد على شركتنا التي تقوم بجميع أعمال إصلاح وتنظيف وفك وتركيب جميع أنواع صيانة سيمنس بكل إتقان فنحن نمتلك جميع الإمكانيات التي تساعدنا على منح عملائنا الكرام خدمات ذات مستوى عالي من الجودة فلا تتردوا في التواصل معنا لتستفيدوا من خدماتنا وأسعارنا المتميزة فنحن نعمل جاهدين لإرضائكم وكسب ثقتكم وهذا ما يجعلنا في سعي متواصل لتحسين وتطوير خدماتنا
القاهرة صيانة سامسونج
القاهرة صيانة ال جي
القاهرة صيانة توشيبا
صيانة سيمنس
القاهرة صيانة بوش
القاهرة صيانة دايو
القاهرة صيانة اريستون
صيانة وايت ويل القاهرة

احمد مديو said...

شركة صيانة سيمنس هي شركة متخصصة في صيانة سيمنس بجميع أنواعها معروفة بتقديمها لخدمات في منتهى الجودة والدقة تسعى من خلالها للوصول إلى العالمية فإذا كنتم بحاجة لعمل صيانة سيمنس
يمكنكم الاعتماد على شركتنا التي تقوم بجميع أعمال إصلاح وتنظيف وفك وتركيب جميع أنواع صيانة سيمنس بكل إتقان فنحن نمتلك جميع الإمكانيات التي تساعدنا على منح عملائنا الكرام خدمات ذات مستوى عالي من الجودة فلا تتردوا في التواصل معنا لتستفيدوا من خدماتنا وأسعارنا المتميزة فنحن نعمل جاهدين لإرضائكم وكسب ثقتكم وهذا ما يجعلنا في سعي متواصل لتحسين وتطوير خدماتنا
القاهرة صيانة سامسونج
القاهرة صيانة ال جي
القاهرة صيانة توشيبا
صيانة سيمنس
القاهرة صيانة بوش
القاهرة صيانة دايو
القاهرة صيانة اريستون
صيانة وايت ويل القاهرة

احمد مديو said...

شركة صيانة سيمنس هي شركة متخصصة في صيانة سيمنس بجميع أنواعها معروفة بتقديمها لخدمات في منتهى الجودة والدقة تسعى من خلالها للوصول إلى العالمية فإذا كنتم بحاجة لعمل صيانة سيمنس
يمكنكم الاعتماد على شركتنا التي تقوم بجميع أعمال إصلاح وتنظيف وفك وتركيب جميع أنواع صيانة سيمنس بكل إتقان فنحن نمتلك جميع الإمكانيات التي تساعدنا على منح عملائنا الكرام خدمات ذات مستوى عالي من الجودة فلا تتردوا في التواصل معنا لتستفيدوا من خدماتنا وأسعارنا المتميزة فنحن نعمل جاهدين لإرضائكم وكسب ثقتكم وهذا ما يجعلنا في سعي متواصل لتحسين وتطوير خدماتنا
القاهرة صيانة سامسونج
القاهرة صيانة ال جي
القاهرة صيانة توشيبا
صيانة سيمنس
القاهرة صيانة بوش
القاهرة صيانة دايو
القاهرة صيانة اريستون
صيانة وايت ويل القاهرة

Nguyen Thanh 90 said...

bán máy in barcodes giá rẻ

Jhon Perker said...

I love this post.
ESET NOD32 Support

Ahcomtech said...

I am not sure where you are getting your information, but great topic. I needs to spend some time learning much more or understanding more. Thanks for wonderful info I was looking for this information for my mission.
bảng giá xe cứu thương cấp cứu ahcomtech moi nhat 2019 quản trị website hà nội

ppsspppsp said...

PPSSPP Gold APK:- Emulation is a very excellent strategy in the tech world to battle against any obsolescence, emulating apps and games have become less
ppsspp gold pc

ppsspppsp said...
This comment has been removed by the author.
Zoya said...

It is one of the best posts that I ve read in a long time. This post is really magnificent. I really like this post. Thanks a lot for this really good post.

Massage Center in Mumbai
Body Massage Center in Mumbai

«Oldest ‹Older   401 – 414 of 414   Newer› Newest»