Member-only story

💎 Ruby 3.3.0 And Rounding To Even That Rounds To Odd Part 1

Tom Smykowski
5 min readJun 27, 2023

--

I was browsing today through changelogs of major programming lamguages, frameworks and libraries, as I usually do.

So far I’ve learned there is nothing new in some. Eventually I stumbled upon Ruby changelogs.

In May a preview of Ruby 3.3.0 was released with some performance improvements.

Thw documentation is pretty scarse though:

  • YJIT
  • Significant performance improvements over 3.2
  • Splat and rest arguments support has been improved.
  • Registers are allocated for stack operations of the virtual machine.
  • More calls with optional arguments are compiled.
  • Integer#!=, String#!=, Kernel#block_given?, Kernel#is_a?, Kernel#instance_of?, Module#=== are specially optimized.
  • Instance variables no longer exit to the interpreter with megamorphic Object Shapes.
  • Metadata for compiled code uses a lot less memory.
  • Improved code generation on ARM64

There is lack of links or details of these so I headed to commit history and stumbled upon something interesting that was done in December 2022.

Kenta Murata committed changes to the numeric.c library:

What caught my attention is that usually mathematics modules don’t change that often for a very good reason. Math don’t change that often too.

Don’t forget to subscribe!

The commit is also about rounding numbers, a topic close to my heart, because in January I wrote an article about how we don’t have a rounding standard. Every programming language rounds stuff differently on default.

But the general idea behind how to round is the same and is mathematically well described.

However, as it occurs, practically, rounding a number by a computer is an adventure of it’s own.

I know maybe mathematics is not the most fascinating topic for some. For me it sometimes…

--

--

Tom Smykowski
Tom Smykowski

Written by Tom Smykowski

Hi! My name is Tom Smykowski, and I’m a Staff Frontend Engineer. Grab a free scalable Angular app checklist: https://tomasz-smykowski.com/scalable-angular

Responses (1)

Write a response