← Graph

Opt New Optimization

concept 1 connections

New Ruby 4.0 VM instruction covering standard object construction (Object.new, MyClass.new). Because YJIT cannot optimize across the Ruby/C boundary in C Ruby, object construction was historically a perf cliff. The new instruction lets the JIT recognise and optimize the construction path, yielding roughly 30% more Object.new throughput on Ruby 3.4 → 4.0 (~10.3M → ~13.4M objects/s in Nutter's benchmark). JRuby doesn't need it because everything is already Java/JVM bytecode that inlines and optimizes uniformly.

category
architecture
about
Opt New Optimization concept
Discusses Ruby 4.0's opt_new VM instruction improving object construction ~30% on C Ruby.

Provenance

Read by
1 extraction