Closed eregon closed 1 year ago
Hmmm. So, I did actually add those to the copy I am using for tracking TruffleRuby performance.
https://github.com/smarr/truffleruby-faststart/commit/f2a232426ca6d399a4f7d61799fb893b5f89ed1b
Not sure why I didn't propagate it back here.
Right, at least for interpreter performance I think adding it makes a lot of sense. Could you apply it to this repo too?
For instance on
Json
it seems like it would make sense given there are lots of String literals, which are actually allocations without# frozen_string_literal: true
as first line. From a quick local run, it's faster on CRuby withfrozen_string_literal
and it is about the same for TruffleRuby:OTOH, maybe we want to measure how well the VM optimizes?
Ruby code in the wild is a mix of
# frozen_string_literal: true
and not using it. Ruby 3 still isn't using that by default over compatibility concerns. I'd think nowadays for performance-sensitive files people typically use# frozen_string_literal: true
.