With support for Java 21, the most recent long-term support version of Java, JRuby moves past Java 8 support and begins integration of Java 21 features. The JRuby team plans to bring 10 years of JVM enhancements to Ruby users. Addressing slow startup times, which has been called the number one complaint from JRuby users, JRuby 10 leverages newer JVM features including:
- Application class data store (AppCDS) – an OpenJDK feature that allows pre-caching code and metadata during startup to reduce the cost of future commands.
- Project CRaC (Coordinated Restore at Checkpoint) – an experimental feature that allows users to “checkpoint” a running process and launch multiple future processes by restoring that checkpoint.
- Project Leyden – an OpenJDK project to improve the startup time, time to peak performance, and footprint of Java programs. The JRuby team will incorporate Leyden flags into JRuby’s launcher as they become available.
These features, combined with the reduced overhead --dev
flag, offer the fastest-ever startups for JRuby, Nutter said.
Compatibility with Ruby 3.4, meanwhile, has allowed the JRuby team to implement Ruby 3.2, Ruby 3.3, and Ruby 3.4 features in JRuby 10. The new JRuby release runs full invokedynamic optimization by default, providing the best available performance on JRuby scripts and applications without passing additional flags. Previous versions of JRuby ran by default in a “middle tier” of optimization, using invokeddynamic optimization only for simple Ruby operations.