Alex Rivera | Logout

Why is Python faster than Ruby?

Asked 2010-07-15T04:56:30.477
14

They seem to share a lot of the same characteristics but as far as I can tell, Python 2.5 is faster than 1.8.7 by a lot.

Is there a deeper underlying reason behind this?

Edit
Report

1 Answer

6

Because Ruby 1.8 was not really designed with performance in mind, while Python was more optimized. In particular, Ruby 1.8 did real interpretation rather than compiling for a virtual machine like most languages these days. Ruby 1.9 (with the YARV VM) is about as fast as Python 3 (maybe a little bit slower, but much closer), and other implementations are even faster.

answered 2010-07-15T05:04:20.003

Your Answer