Commit f6b35d44
f6b35d4407fbMerged
Yukihiro "Matz" Matsumoto <[email protected]> · 8 months ago · 1 file · +1 added
Description
Port send_bmethod: replace define_method with def
define_method with static block body is equivalent to def for AOT. Spinel <0.01s vs CRuby 0.22s (>22x) 83/83 tests pass.
Co-Authored-By: Claude Opus 4.6 (1M context) [email protected]
Details
- Commit
- f6b35d4407fb
- Parent
- 52672ded9c57
examples/bm_send_bmethod.rbaddedView file
1+
# send_bmethod benchmark (from yjit-bench)2+
# define_method replaced with def (equivalent for AOT)3+
4+
def zero5+
06+
end7+
8+
def one(arg)9+
arg10+
end11+
12+
total = 013+
n = 014+
while n < 50000015+
zero16+
total = total + one(123)17+
zero18+
total = total + one(123)19+
zero20+
total = total + one(123)21+
zero22+
total = total + one(123)23+
zero24+
total = total + one(123)25+
zero26+
total = total + one(123)27+
zero28+
total = total + one(123)29+
zero30+
total = total + one(123)31+
zero32+
total = total + one(123)33+
n = n + 134+
end35+
puts total36+
puts "done"