3 ms·
Tried implementing the first example in Ruby but a benchmark showed that a simple if-case was faster. I guess the RubyVM does a lot under the hood that hurts t
by Alifatisk 3y ago
Tried implementing the first example in Ruby but a benchmark showed that a simple if-case was faster.
I guess the RubyVM does a lot under the hood that hurts the performance like returning boolean true instead of the integer 1, which I have to solve by type
conversion, thus degrading the performance.
Monkeypatching is possible but adds more instructions to the vm anyways.