- Add a new
msgspec.Raw
type for delayed decoding of message fields / serializing already encoded fields. - Add
omit_defaults
option toStruct
types (docs). If enabled, fields containing their respective default value will be omitted from serialized message. This improves both encode and decode performance. - Add
rename
option toStruct
types (docs) for altering the field names used for encoding. A major use of this is supportingcamelCase
JSON field names, while letting Python code use the more standardsnake_case
field names. - Improve performance of
nogc=True
structs. GC is now avoided in more cases, andnogc=True
structs use 16 fewer bytes per instance. Also added a benchmark for howmsgspec
can interact with application GC usage. - Cache creation of tagged union lookup tables, reducing memory usage for applications making heavy use of tagged unions.
- Support encoding and decoding
frozenset
instances - A smattering of other performance improvements.