Re:Rust: Zero-Cost Abstraction in Action
by jashmatthews on Friday February 07, 2020 @04:37PM
(#22271241)
10+ years ago this was true but CRuby's basic operations like += (bytecode is opt_plus followed by setlocal) don't do method lookup unless you redefine them and even if you do then it uses inline caches in the bytecode so there's only one hash lookup.
TruffleRuby has been constant folding trivial code like this since 2014. AOT is also an option.
TruffleRuby has been constant folding trivial code like this since 2014. AOT is also an option.