This defines 37% faster method when it takes no argument.
Benchmark:
Warming up --------------------------------------
old 551.697k i/100ms
new 721.906k i/100ms
Calculating -------------------------------------
old 6.511M (± 0.8%) i/s - 33.102M in 5.084530s
new 8.925M (± 1.0%) i/s - 44.758M in 5.015619s
Further description is at https://bugs.ruby-lang.org/issues/19287
This defines 37% faster method when it takes no argument.
Benchmark: Warming up -------------------------------------- old 551.697k i/100ms new 721.906k i/100ms Calculating ------------------------------------- old 6.511M (± 0.8%) i/s - 33.102M in 5.084530s new 8.925M (± 1.0%) i/s - 44.758M in 5.015619s
Comparison: new: 8924652.2 i/s old: 6510691.1 i/s - 1.37x (± 0.00) slower