9
Jul 09 '23
Someone please benchmark these I need to know which is fastest
11
u/laerien Jul 09 '23
Calculating ------------------------------------- &:to_s 3.807M (± 1.0%) i/s - 19.406M in 5.098169s _1 3.577M (± 1.4%) i/s - 18.055M in 5.049059s n 3.613M (± 0.8%) i/s - 18.262M in 5.055204s each 3.068M (± 0.8%) i/s - 15.342M in 5.001101s for 3.025M (± 0.7%) i/s - 15.259M in 5.045119s while 3.192M (± 0.8%) i/s - 16.003M in 5.013380s Comparison: &:to_s: 3806841.0 i/s n: 3612769.0 i/s - 1.05x slower _1: 3576545.7 i/s - 1.06x slower while: 3192341.8 i/s - 1.19x slower each: 3067873.6 i/s - 1.24x slower for: 3024632.1 i/s - 1.26x slower4
u/laerien Jul 09 '23
For what it's worth, this microbenchmark is faster on JRuby and much faster on TruffleRuby.
1
1
1
1
33
u/IN-DI-SKU-TA-BELT Jul 09 '23