Skip to content
This repository was archived by the owner on Jun 20, 2025. It is now read-only.

0.2.0

Pre-release
Pre-release

Choose a tag to compare

@phan-do phan-do released this 27 Nov 16:16
· 258 commits to main since this release

Release Notes

WE'RE FASTER THAN std.json NOW LETS GOOOOOOOOOOOOOOOOOOO!

We were already faster for some things, like serializing large integers and long strings, but now we're faster than (or as fast as) std.json for pretty much everything! At least, I think we are. I'm planning on doing some formal benchmarks later on. For now, I've just been using hyperfine and (de)serializing different kinds of values a bunch of times. I have ran this benchmark though, and both Getty JSON and std.json came up even with each other. So woohoo!

I'm really happy with the optimizations I was able to get in this release. I've never really done serious performance optimization work before so it felt good whenever I found a small little thing I could change that gave the library a little boost. It's like a little adrenaline kick each time!

Aside from optimizations, most of the changes this release has been bug fixes and updates to keep up with changes in Getty. This release also contains the first contribution from someone other than me: @LordMZTE! They helped fixed a few important bugs and we've had some great discussions about the library and Getty, so shout out to them!

Changelog

General

  • Added Zigmod support.

Serialization

  • Update union serialization to use the externally tagged representation.
  • Added an internal map key serializer to ensure that keys are properly serialized as strings.
  • Properly escape struct fields during serialization.
  • Integer formatting code has been generalized to all integer types.
  • Optimizations:
    • Validate struct field names at compile-time instead of at run-time.
    • Use a lookup table instead of a switch to see whether 1-byte characters need escaping.
    • Remove unnecessary fixed buffer write during float serialization.

Deserialization

  • Added support for unions (tagged and untagged).
  • Unescape deserialized strings (@LordMZTE , c4ab5b5).
  • Optimizations:
    • Ensure that if an f16, f32, or f64 is being deserialized into, the optimized parsing algorithm will be used.