Ruby 3x3 is here: what does it mean?

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.
Ruby 3x3 is here: what does it mean? #ruby #rubydeveloper #rubyonrails https://rubyonrails.ba/single/ruby-3x3-is-here-what-does-it-mean

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles