This morning I though I was done optimizing the ruby/json parser, so I was doing some final cleanups before the 2.8.0 release. But nope, I found two more ~10% wins back to back...
This will never end...
https://github.com/ruby/json/pull/692
=> More informations about this toot | More toots from byroot@ruby.social
@byroot WOW - Need to do some benchmarks for our primary cases where we had to use Oj for performance reasons. The outlook that we can eliminate another dependency and simplify is just amazing! Thank you very much!
=> More informations about this toot | More toots from tisba@ruby.social
@tisba my pleasure.
As mentioned in a previous post, if you find some real world JSON document that very significantly slower to parse with ruby/json than with alternatives, please let me know I'll treat it as a bug.
=> More informations about this toot | More toots from byroot@ruby.social
@byroot Will do 🫡
One case where I'm not sure if (or how well) is covered by the json gem is parsing JSON lines files. That worked very well and efficient with Oj (e.g. via Oj.load with block).
=> More informations about this toot | More toots from tisba@ruby.social
@tisba Right, that's not something supported by the JSON gem, so it might not perform that well overall as you'll probably have to do the line splitting yourself.
It's not that rare of a use case though, so it could potentially be added, just not high priority, if anything I'm trying to remove bad features right now...
=> More informations about this toot | More toots from byroot@ruby.social
@byroot I'm 100% with you on this. Cleaning up is great, but feature and complexity creep is always something to be very careful with.
Splitting JSON lines files in Ruby-land and passing to JSON.parse is most likely be terrible compared to Oj. I have no idea how Oj works, but I assume you can pull all kinds of tricks when you can do both in C-land (e.g. JSON objects tend to be very similar).
I’ll probably switch all all other cases from Oj to JSON regardless and keep Oj only where nessessary.
=> More informations about this toot | More toots from tisba@ruby.social
@byroot We appreciate the work you’ve been doing Jean!
=> More informations about this toot | More toots from travisbell@mastodon.social This content has been proxied by September (3851b).Proxy Information
text/gemini