Ancestors

Toot

Written by Jean Boussier on 2024-11-06 at 12:57

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

Descendants

Written by Sebastian Cohnen on 2024-11-06 at 13:32

@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

Written by Jean Boussier on 2024-11-06 at 13:54

@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

Written by Sebastian Cohnen on 2024-11-06 at 14:10

@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

Written by Jean Boussier on 2024-11-06 at 14:25

@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

Written by Sebastian Cohnen on 2024-11-06 at 15:37

@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

Written by Travis Bell on 2024-11-06 at 16:04

@byroot We appreciate the work you’ve been doing Jean!

=> More informations about this toot | More toots from travisbell@mastodon.social

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113436119795168302
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
338.897768 milliseconds
Gemini-to-HTML Time
1.709496 milliseconds

This content has been proxied by September (3851b).