-
-
Notifications
You must be signed in to change notification settings - Fork 939
Open
Description
Summary
Range#to_a is slower in JRuby 10 compared to JRuby 1.7.
Benchmark
require 'benchmark'
Benchmark.bm(15) do |x|
x.report("Range#to_a") { 100_000.times { (1..100).to_a } }
endResults
| Ruby | Time | Regression |
|---|---|---|
| MRI 3.4.7 | 0.0011s | baseline |
| JRuby 1.7.27 | 0.0004s | 0.4x (faster than MRI) |
| JRuby 10.0.2.0 | 0.0013s | 3.25x slower than JRuby 1.7 |
JRuby 1.7 was significantly faster than MRI for this operation. JRuby 10 is now slightly slower than MRI and 3.25x slower than JRuby 1.7.
Note: Absolute times are sub-millisecond, so this may only be noticeable in tight loops.
Environment
- JRuby 10.0.2.0 on Java 21 (Temurin 21.0.9)
- JRuby 1.7.27 on Java 8 (Corretto 8.472)
- MRI 3.4.7
- macOS Darwin 25.1.0
Metadata
Metadata
Assignees
Labels
No labels