If you haven't upgraded yet, Ruby 4.0's garbage collection is generally much faster than 3.4. This patch release fixes the one area there had previously been a notable regression (allocating/freeing Classes).
John Hawthorn
Ruby 4.0.4 Released www.ruby-lang.org/en/news/2026...
This is a routine update that includes bugfixes. We recommend upgrading your Ruby version at your earliest convenience.