Ruby3 - performance

Hi

I started the script from Ruby: new in 3.0

def tarai(x, y, z) =
x <= y ? y : tarai(tarai(x-1, y, z),
tarai(y-1, z, x),
tarai(z-1, x, y))
require 'benchmark'
Benchmark.bm do |x|
# sequential version
x.report('seq'){ 4.times{ tarai(14, 7, 0) } }

# parallel version
x.report('par'){
4.times.map do
Ractor.new { tarai(14, 7, 0) }
end.each(&:take)
}
end

-> Ruby2.6 is faster then 3.0.2 -- which results do you get?

ruby2 xx.rb
user system total real
seq283.721294 0.739890 284.461184 (381.326964)

ruby3 xx.rb
user system total real
seq332.654003 0.663264 333.317267 (337.200434)
par<internal:ractor>:267: warning: Ractor is experimental, and the behavior may change in future versions of Ruby! Also there are many implementation issues.
327.740577 0.386809 328.127386 (200.534791)

So Ruby3 is 15% slower on my system.

Opti