News for hackers. Stuff that matters.
Re:Optimizing Ruby's JSON, Part 1 by lexicality on Wednesday December 18, 2024 @12:43PM (#42452837)
Possibly I've missed it, but is there anything saying how long the new version takes to parse/encode the Twitter JSON dump with all optimisations applied?
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:

  - https://github.com/ruby/json/releases/tag/v2.7.3
  - https://github.com/ruby/json/releases/tag/v2.8.0
Re:Optimizing Ruby's JSON, Part 1 by _gtly on Wednesday December 18, 2024 @05:41PM (#42456290)
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...

Re:Optimizing Ruby's JSON, Part 1 by kristianp on Wednesday December 18, 2024 @05:56PM (#42456437)
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?

Re:Optimizing Ruby's JSON, Part 1 by byroot on Friday December 20, 2024 @05:05PM (#42475530)
> 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.