Jean Boussier
Jean Boussier
Also if we go with this, the JRuby and TruffleRuby implementations will need the feature for parity.
> Do you know top of mind which versions that would have landed in? It's in `8.1.0.alpha` and will be released with Rails `8.1.0`. As for the `String#gsub` optimizations, they'll...
> Looking at the performance improvements of using `gsub`, it looks like they won't be enough to bring us in line with Oj, right? I don't know, would be worth...
> Funny you should mention that, while we were building the thing this is _exactly_ what we wanted, but also... how do we even do that 😅 It's not that...
Your benchmark is missing the most important important optimization we found with @etiennebarrie which is to gsub binary mode: https://gist.github.com/byroot/e5dc39f0ce15ae1869bc7511ebc522e0 ```ruby $ ruby --yjit /tmp/je.rb /opt/rubies/head/lib/ruby/3.5.0+0/bundler/runtime.rb:58: warning: benchmark/ips is found...
> It feels like it's a bug in CRuby To be too, but the regexp engine kinda flies over my head, so I haven't attempted to figure out a solution....
> it potentially discards the computed coderange That specifically isn't a concern, because the coderange of `JSON.dump` isn't known. But yes, I generally agree it would be a good idea...
I'm going to close this, as I don't think this extra complexity is worth the benefits. I'd however be open to introduce some escaping methods, e.g. `JSON.escape_script(json_document)`, akin to `GCI.escape_html`...
Arf. Happy to look some more into this in the future if you got a failing test. Was a nice optimization :/
> So I think that part of your PR is redundant. Hum. If so that doesn't explain how `rubocop` could possibly have been loaded in production 🤔. Unless these gems...