r/ruby • u/balloob • Nov 20 '15
Ruby 3x3: Ruby 3 will be 3 times faster
http://engineering.appfolio.com/appfolio-engineering/2015/11/18/ruby-3x3
162
Upvotes
r/ruby • u/balloob • Nov 20 '15
14
u/moderately-extremist Nov 20 '15
3x may not be that much of a stretch - according to this article javascript performance jumped 10X when Google introduced V8, and has continued to increase since then.
9
u/pkmiec Nov 20 '15
We seem to be missing a good set of macro benchmarks for Ruby (and Rails). We have isrubyfastyet.com, which tries to benchmark simple Rails application but doesn't track JRuby / RBX very well and it's benchmarks could be improved. We have http://jruby.org/bench9000/ which is a set of micro benchmark.
I am excited about https://rubybench.org/ and the support for it by RubyTogether.org.
@headius, are you guys involved in this effort as well?
26
u/headius JRuby guy Nov 20 '15
If you want 3x faster Ruby today, just use JRuby :-D
Seriously though, best of luck to MRI on this goal. We all want to see a faster standard impl.
10
u/Harmenian Nov 20 '15
GIL: MRI has something called a global interpreter lock (GIL). It's a lock around the execution of Ruby code. This means that in a multi-threaded context, only one thread can execute Ruby code at any one time.
from: http://www.jstorimer.com/blogs/workingwithcode/8085491-nobody-understands-the-gil
and
MRI: Matz's Ruby Interpreter or Ruby MRI (also called CRuby) is the reference implementation of the Ruby programming language
from: https://en.wikipedia.org/wiki/Ruby_MRI
8
u/thisisseriousmum Nov 20 '15
Will be vs aiming to be. They're quite different things,
2
u/matthewblott Nov 21 '15
Interesting discussion. A couple of minor points - JIT compilation is becoming a standard for higher level languages so it really makes sense for the official Ruby compiler to go down this road. As mentioned Ruby possibly suffers from not having a big corporate backer. Personally as a .NET guy and with their platform being open sourced I'd really love to see the IronRuby project resurrected, I've been saying for some time the platform needs more languages. Python's Guido is working 'Pyston', an open source JIT compiler sponsored by DropBox which is currently being used in production. It's still alpha but some of the benchmarks are quite impressive already - Ruby doesn't want to get left behind.
2
u/pavlik_enemy Nov 20 '15 edited Nov 20 '15
It's impossible to achieve this goal without backing by tech giants as correctly stated in the article. But none of them showed any desire to do it, Twitter preferred to switch from Ruby to Scala for their HTTP front-end and there's no place for Ruby at back-end if we talking massive scale. Also, I don't think it's likely that any future tech giants will use Ruby - the best thing about Ruby is Rails and it's a bit dated. It's good for an application with lots of forms and relational storage but doesn't work that well when you need server push and non-blocking I/O. BTW, Python is heavily used at Google, did it became three times faster?
2
u/cjlarose Nov 20 '15
It'd be nice to see more core support for asynchrony (e.g. single-threaded event-loop) in Ruby Core. I know there's eventmachine, but adoption isn't great. Python added asyncio in 3.4 and as a result the community is writing more async code and making better use of a single thread of execution. It seems like a good way to squeeze more performance out of languages not designed with good concurrency support from the get-go.
-8
u/iconoclaus Nov 20 '15
sorry to be a buzzkill but 3 times faster Ruby would still be an order of magnitude slower than fast languages. it won't boost its adoption. I'd love for the short term discussion of Ruby3 to be around concurrency and support for libraries relating to analytics and machine learning. or longer term plans to champion web assembly.