Re:Optimizing Ruby's JSON, Part 1
by byroot on Wednesday December 18, 2024 @01:27PM
(#42453316)
There's quite a few more commits to go before the final result, but you can see it in the release notes:
[ Parent
| on HN ]
Unrelated to json, but a Rails commit by you 2024-10-29: ActiveModel::Type::Integer#serialize 3.17x - 9.67x faster!
https://github.com/rails/rails/commit/70ca4ab91af15714cae4e8...
Note that urls in preformatted text are not rendered as links.
Clickable:
https://github.com/ruby/json/releases/tag/v2.7.3
https://github.com/ruby/json/releases/tag/v2.8.0
Looks like v2.8.0 processes twitter.json at about half a gigabyte/s. The size of twitter.json has changed between the versions, I wonder why that is?
> The size of twitter.json has changed between the versions, I wonder why that is?
For parsing benchmarks, it read the pretty formatted file that is committed in the repository.
But for generation benchmarks it doesn't dump it pretty formatted, so there's much less whitespaces and newlines making the file a bit smaller.