Skip to content

Version 0.6.0

Choose a tag to compare

@jcrist jcrist released this 06 Apr 17:41
  • Add a new msgspec.Raw type for delayed decoding of message fields / serializing already encoded fields.
  • Add omit_defaults option to Struct 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 to Struct types (docs) for altering the field names used for encoding. A major use of this is supporting camelCase JSON field names, while letting Python code use the more standard snake_case field names.
  • Improve performance of nogc=True structs. GC is now avoided in more cases, and nogc=True structs use 16 fewer bytes per instance. Also added a benchmark for how msgspec 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.