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.”

Özgür
  • 8,077
  • 2
  • 68
  • 66
  • 3
    If you have two questions, please ask them separately. – T.J. Crowder May 24 '11 at 07:13
  • @T.J. Crowder, but they are related to each other, what is wrong with asking multiple questions in one thread? – Özgür May 24 '11 at 07:17
  • 1
    @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. – Chuck May 24 '11 at 07:30
  • @Chuck I am not the first one asking multiple questions in SO, yet I edited my question accordingly. Thanks. – Özgür May 24 '11 at 07:34
  • 3
    Don't choose which Ruby to use based on a single benchmark. – Andrew Grimm May 24 '11 at 13:16
  • @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. – Özgür May 24 '11 at 17:39
  • FYI, I have found some slides regarding performance engineering in Twitter, which includes a bit comparsion of Ruby Interpreters: http://blog.evanweaver.com/2011/04/27/performance-engineering-at-twitter/ – Özgür May 26 '11 at 18:08

3 Answers3

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.

DarkDust
  • 90,870
  • 19
  • 190
  • 224
  • So people prefer to use MRI without considering its performance shortcomings, and just for the sake of popularity? – Özgür May 24 '11 at 07:44
  • 4
    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. – the Tin Man May 24 '11 at 07:59
  • 3
    @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. – DarkDust May 24 '11 at 07:59
  • 1
    @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. – Özgür May 24 '11 at 08:23
  • 7
    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. – Wukerplank May 24 '11 at 08:47
  • @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. – the Tin Man May 25 '11 at 00:38
  • +1 @Wukerplank "Even if you pick up more traffic MRI won't be the first bottle neck." Exactly! – the Tin Man May 25 '11 at 00:43
  • Hey.. @DarkDust Inventor of Ruby is Yukihiro Matsumoto.. – Jyothu Apr 04 '13 at 06:24
  • @Jyothu Thanks, typo, have fixed it. – DarkDust Apr 04 '13 at 07:39
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/

Michael Kohl
  • 66,324
  • 14
  • 138
  • 158
  • 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 ? – Özgür May 24 '11 at 09:09
  • 3
    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. – Michael Kohl May 24 '11 at 09:36
  • Thanks for the answer but I can pick only one. – Özgür May 27 '11 at 05:59
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.

David Unric
  • 7,421
  • 1
  • 37
  • 65
  • 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: http://blog.tstmedia.com/news_article/show/86942?referrer_id=308069 http://news.ycombinator.com/item?id=2549240), – Özgür May 24 '11 at 14:01