Commit f3fc9047

f3fc90475547Merged

Yukihiro "Matz" Matsumoto <[email protected]> · 8 months ago · 2 files · +1 added · ~1 modified

Description

Add Integer#itself, port cfunc_itself benchmark

itself returns self (identity). Spinel <0.01s vs CRuby 0.21s. 68/68 tests pass.

Co-Authored-By: Claude Opus 4.6 (1M context) [email protected]

Details

Commit
f3fc90475547
Parent
2912f5b95547

examples/bm_cfunc_itself.rbaddedView file

1+# cfunc_itself benchmark (from yjit-bench)
2+# Integer#itself returns self
3+
4+total = 0
5+n = 0
6+while n < 500000
7+ i = 0
8+ while i < 10
9+ total = total + i.itself
10+ i = i + 1
11+ end
12+ n = n + 1
13+end
14+puts total
15+puts "done"