<asp_>
Wasn't sure about the title - hope that's all right. I'll have a go at writing a spec.
<headius[m]>
Looks good, thanks!
<headius[m]>
Should be working in 9.2.7 or .6
<asp_>
Yep, it's working in 9.2.7
<headius[m]>
👍
rusk has joined #jruby
dopplergange has quit [Ping timeout: 258 seconds]
whitingjr has joined #jruby
whitingjr has quit [Quit: Leaving.]
shellac has joined #jruby
sagax has joined #jruby
drbobbeaty has joined #jruby
shellac has quit [Quit: Computer has gone to sleep.]
dopplergange has joined #jruby
<rdubya[m]>
headius: saw your bug report on Symbol#to_s not returning the same string object (https://bugs.ruby-lang.org/issues/16150), we use that relatively frequently in our app, would it make sense/be possible to add a jruby flag that could be set to have it always return frozen strings (maybe it applies to all "primitives" like you mentioned in the ticket)
<rdubya[m]>
Just thought maybe that would be a way to optionally get the functionality in before the full language changes get hammered out
<headius[m]>
That's a good idea. We could test everything. I'm still traveling but it might be a trivial PR to submit if you want to try it
<headius[m]>
PR doesn't have to make it optional at first and we can see what fails
<headius[m]>
Just need another field in RubySymbol to cache the frozen RubyString
<headius[m]>
You could try throwing your app at the branch too
<rdubya[m]>
Cool, yeah I'll see if I can figure it out
shellac has joined #jruby
<headius[m]>
I don't know why someone didn't think of this earlier. All that String allocation
<headius[m]>
Credit to schneems for the inspiration
<rdubya[m]>
I guess I just assumed that it was already happening lol
<headius[m]>
It didn't occur to me until his talk and then is was duh
<headius[m]>
We do reuse the same ByteList but it's still a waste of an object
<headius[m]>
Oh actually it wasn't indifferent so the client code has to always to_s but same deal
<headius[m]>
His patch was very localized...this broader change could have a big impact
<headius[m]>
Also nil, true, false
<rdubya[m]>
I wonder if it would make sense to have a patch on indifferent access that stores a hash of cached strings, would mean a double hash lookup every reference though, so would probably slow things down
<headius[m]>
That's essentially what schneems did in another location
<headius[m]>
I think it was for respond_to? Against a model...lazily caches the sym to string
<rdubya[m]>
cool, yeah could see that getting hot too