Why is MRI the mainstream Ruby interpreter, while it performs the worst? [closed]
Asked Answered
S

3

0

Having seen this interpreter comparison graph, I wondered the reasons behind the MRI's mainstream usage, although it performs the worst. Why aren't Kiji or Ruby Enterprise Edition used more frequently; lack of gem support or something else? Ruby comparison graph

For instance, Ruby Enterprise Edition is chosen by some of the most popular companies, thanks to its copy-on-write feature; I wonder if any other interpreter implements it.

REE can be easily installed in parallel to your existing Ruby interpreter, allowing you switch to REE with minimal hassle or risk. REE has been out for several years now and is already used by many high-profile websites and organizations, such as New York Times, Twitter, Shopify and 37signals.

“We switched to enterprise ruby to get the full benefit of the [copy-on-write] memory characteristics and we can absolutely confirm the memory savings of 30% some others have reported. This is many thousand dollars of savings even at today’s hardware prices.”

Sinuosity answered 24/5, 2011 at 7:8 Comment(7)
If you have two questions, please ask them separately.Recorder
@T.J. Crowder, but they are related to each other, what is wrong with asking multiple questions in one thread?Kandrakandy
@Comptrol: This is a question-and-answer site. The idea is that there is a right answer for a question, and you're supposed to select that one. If a question is really two questions, then two answers will be right, and you can't select them both.Supermarket
@Supermarket I am not the first one asking multiple questions in SO, yet I edited my question accordingly. Thanks.Kandrakandy
Don't choose which Ruby to use based on a single benchmark.Wray
@Andrew Grimm, There are 3 benchmark results pointing to the same direction, read my other comments. Yet, not implementing copy-on-write, MRI/YARV doesn't support memory reduction in multiple processes as REE does. I am open to read other benchmarks.Kandrakandy
FYI, I have found some slides regarding performance engineering in Twitter, which includes a bit comparsion of Ruby Interpreters: blog.evanweaver.com/2011/04/27/…Kandrakandy
C
6

MRI is short for Matz's Ruby Interpreter. Matz is short for Yukihiro Matsumoto which is the name of the inventor and main author of Ruby. And that's why it is the main implementation: it is the original implementation, all others appeared later. MRI is still the reference, all others need to be compatible with MRI. But Matz tries to make the development more specification-driven instead of implementation-driven, AFAIK.

Cortese answered 24/5, 2011 at 7:42 Comment(9)
So people prefer to use MRI without considering its performance shortcomings, and just for the sake of popularity?Kandrakandy
No, we use it because it's plenty fast enough in real world use, and it is the standard for the language. If something is supposed to work it will work with MRI.Immersed
@Comptrol: Maybe also due to popularity, but I guess the main reason they use it is because it is the reference. If it's (correct) Ruby code you can rely that it will work most correctly on MRI, simply because MRI essentially defines what is "correct". Also, I have no idea how much of the Ruby standard library is provided by the other implementations (like OpenSSL bindings and stuff). So it's possible that MRI provides features/libraries that might be missing on other implementations.Cortese
@the Tin Man, what do you mean by "real world use", aren't twitter and 37Signals "real world use"? AFAIK, 37signals/svn is the most popular company to market Ruby on Rails, yet even they don't use MRI but REE. Twitter is another example, they developed their own implementer, Kiji, out of REE.Kandrakandy
Unless you have a very heavy traffic site already, MRI is enough for the start. There is a package for all important Linux distros and installing it is a one line command. Other implementations maybe better in performance but in the early stage of an app (when traffic is low etc.) it would be premature optimization. Even if you pick up more traffic MRI won't be the first bottle neck.Pompidou
@Comptrol, real world is inside corporate firewalls in addition to outside the firewalls. MRI is plenty fast when the system is written well, with profiling and optimization occurring to identify bottlenecks when needed. In addition, any "real" site is going to have the hardware infrastructure to provide load balancing and caching which reduces the load on the individual system. Some implementations are faster but what "real" site puts only one host without the hardware infrastructure? Odds are good they chose REE for stability and long-term support. Speed is secondary with the hardware there.Immersed
+1 @Pompidou "Even if you pick up more traffic MRI won't be the first bottle neck." Exactly!Immersed
Hey.. @Cortese Inventor of Ruby is Yukihiro Matsumoto..Argos
@Argos Thanks, typo, have fixed it.Cortese
W
4

Why aren't Kiji or Ruby Enterprise Edition used more frequently;

Why are you assuming they aren't? We are a Rails shop and host our app on REE, as do most other companies I personally know that use Rails. We also have branches for JRuby and Rubinius which we occasionally rebase to leave us the option of eventually switching interpreter.

One reason for using MRI is that it's the canonical Ruby implementation by the language creator itself, which was basically the only "official" language specification before RubySpec came around:

http://www.rubyspec.org/

Whoop answered 24/5, 2011 at 8:23 Comment(3)
I assume such because no tutorial/book mentions either Ruby Enterprise Edition or Kiji; but just MRI, JRuby and Rubinious. Btw, do you use REE with Rails 3.0 ?Kandrakandy
What's there to mention? REE is basically MRI with some patches for better garbage collection etc., not something that moves Ruby to a new platform (JRuby) or a JIT compiled byte level VM (Rubinius). I'm not saying I don't appreciate REE or Kiji, I'm just saying that hopefully sooner or later they will be obsoleted by better GC in MRI itself. BTW: no Rails 3 for us yet, too much legacy code.Whoop
Thanks for the answer but I can pick only one.Kandrakandy
S
3

Your mentioned performance graph tested the MRI ver. 1.8. The current "official" Ruby implementation 1.9.2 based on YARV is magnitude faster and generally faster then Rubinius or on par with JRuby. So the conclusions are no more valid, although many sites and other deployments use MRI 1.8 which is "fast enough" for them.

Singultus answered 24/5, 2011 at 11:7 Comment(1)
What is your source of 1.9.2's overperformance to REE 1.8.7, I would really like to read some benchmark results. Here are mines: blog.tstmedia.com/news_article/show/86942?referrer_id=308069 news.ycombinator.com/item?id=2549240),Kandrakandy

© 2022 - 2024 — McMap. All rights reserved.