Ruby 3x3 is here: what does it mean?

05-Oct-2020 1876
About a month ago, Ruby core committed to Ruby 3.0 being the next release. There will be no Ruby 2.8. Since Ruby always releases around Christmas, that means that we'll be getting Ruby 3 this December.We're finally here. What amazes me is that I remember Matz talking about Ruby 3 releasing in 2020 at least 5 years ago (2020 being the year of the Tokyo Olympics, or at least, it was going to be). That's pretty good release planning!One of the most important "features" to come from Ruby 3.0 will be "Ruby 3x3", the promise that Ruby 3 will be 3 times faster than Ruby 2.0. Well, will it?It's important to remember that Ruby core had a very specific vision in mind when they promised "Ruby 3x3". Ruby 3x3 is an abbreviation for: "Ruby 3 will be 3 times faster on the optcarrot benchmark than Ruby 2.0".What's the optcarrot benchmark? It's a Nintendo emulator. No really - it plays NES games. It was created by mame, aka Yusuke Endoh, an important Ruby core member. Ruby 2.0 roughly did about 25 frames per second on this benchmark. So, Ruby 3 would have to do 75 fps to meet the promise.What you should be asking yourself right now is: how does optcarrot relate to performance in a Rails application? If Ruby is 3x faster on this benchmark, will it run Rails 3x faster?The answer is definitely not. optcarrot differs from Rails apps in one very important way: it creates hardly any objects. I mean, it makes sense if you think about it: the original NES had just 2 kilobytes (!!!) of onboard RAM. Today, that amount of memory would hold just 50 very small Ruby strings. The average Rails application creates over 1000 times that many objects on every single request.
Use coupon code:

RUBYONRAILS

to get 30% discount on our bundle!
Prepare for your next tech interview with our comprehensive collection of programming interview guides. Covering JavaScript, Ruby on Rails, React, and Python, these highly-rated books offer thousands of essential questions and answers to boost your interview success. Buy our 'Ultimate Job Interview Preparation eBook Bundle' featuring 2200+ questions across multiple languages. Ultimate Job Interview Preparation eBook Bundle