Releases: getty-zig/json
0.4.0
Release Notes
What's in 0.4.0
This release is a small one, intended to keep the library up-to-date with Getty 0.4.0.
Improvements
- The
MapKeyDeserializernow implementsdeserializeIgnored, allowing map keys to be ignored. (c786403) - Getty JSON can now be installed via Zig's package manager. (1dd5a2f)
Other Changes
There are other changes in the Getty JSON 0.4.0 release. You can see the full changelog here.
0.3.0
Release Notes
What's in 0.3.0
Features
- With a new
MapKeyDeserializer, maps with keys that are not strings (e.g.,std.AutoHashMap(i32, i32)) can now be deserialized into. (1f533ef, 086dcf4) deserializeAnyhas been implemented byDeserializer, allowing users to deserialize from multiple possible data types. (cec8be4)
Improvements
- The custom integer formatting and math code we had has largely been replaced by
stdequivalents, which we were able to merge in. (03285fe, ca625fe) StructAccessproperly unescapes keys now. (487163a)StructAccessnow overridesisKeyAllocated, allowing it to specify to the visitor, on a key-by-key basis, whether or not a deserialized key was allocated. (487163a)- Elements and entries are no longer serialized once they're specified length is reached. (c9e7a5b).
Bug Fixes
- The
std.ArrayListused intoSliceWithandtoPrettySliceWithare now properly freed. Before, they were only freed when an error arose. 7e8314b - Ending tokens are now properly parsed. Before, they didn't account for characters such as whitespace. (6f25a28)
- Thank you to @LordMZTE for bringing this issue up!
deserializeIgnorednow callsvisitVoidinstead of just returning avoidvalue. (c9e7a5b).
Other Changes
There are other changes in the Getty JSON 0.3.0 release. You can see the full changelog here.
0.2.0
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
v0.1.0
Features
- Core (de)serialization capabilities.
- Customization of (de)serialization via Blocks and Tuples.
- Serialization support for the following types:
- Array
- Bool
- Enum
- Error set
- Floating-point
- Integer
- Null
- Optional
- One pointer
- Slice
- Struct
- Tuple
- Union
- Vector
- Void
std.ArrayListAligned,std.ArrayListAlignedUnmanagedstd.HashMap,std.HashMapUnmanagedstd.SinglyLinkedList,std.TailQueue
- Deserialization support for the following types:
- Array
- Bool
- Enum (non-literal)
- Floating-point
- Integer
- Optional
- One pointer
- Slice
- Struct
- Tuple
- Union
- Void
std.ArrayListAligned,std.ArrayListAlignedUnmanagedstd.HashMap,std.HashMapUnmanagedstd.SinglyLinkedList,std.TailQueue