Running your benchmarks with Ruby 3.3.3 and JRuby 9.2.14.0 on macOS 14.5 on a 2018 Macbook Pro 2.7 Ghz i7, here's some simple observations by running top
while the benchmarks run.
- JRuby uses a lot more memory. > 20+ GB vs < 10 GB.
- JRuby uses multiple cores, MRI Ruby does not.
I think all your benchmarking is that JRuby will use multiple cores to run the benchmark in parallel, but it's a memory hog. You can potentially recover this in MRI Ruby by using several Ractors, one or two for every core, to load data in parallel.