too simple Ruby yjit program
source code
# The Computer Language Benchmarks Game
# https://salsa.debian.org/benchmarksgame-team/benchmarksgame/
# mtime side-effect
open("./one", "w").close()
n = ARGV[0].to_i
sum = 0.0
flip = -1.0
for i in 1..n do
flip *= -1.0
sum += flip / (2*i - 1)
end
puts "%0.9f" % (sum*4.0)
# mtime side-effect
open("./two", "w").close()
notes, command-line, and program output
NOTES:
64-bit Ubuntu quad core
ruby 3.4.0dev
(2024-12-25
master f450108330)
+YJIT +PRISM [x86_64-linux]
Thu, 26 Dec 2024 04:17:36 GMT
COMMAND LINE:
/opt/src/ruby-3.4.0/bin/ruby --yjit -W0 toosimple.ruby 10000000000
PROGRAM OUTPUT:
3.141592653