Skip to content

v0.1.2

Choose a tag to compare

@doronz88 doronz88 released this 17 Oct 21:03
· 10 commits to master since this release
7525555

Highlights

⚡ Faster records

Each record class now gets its own parse, read and build, compiled when the class is defined, so calls no longer work out on each call what the record needs. A record with a Const magic parses in 0.14 µs instead of 0.29 µs, the same as hand-written struct.unpack_from into a dataclass, and builds in 0.10 µs instead of 0.16 µs. Other record shapes are 1.2-2.6x faster, with the largest gains for records with padding or enum fields. Enum fields now decode with a member lookup instead of calling the enum. The benchmark now includes a ctypes column.

The API, results and errors are unchanged.

🐛 @dataclass(slots=True) records

Records declared with slots=True failed on every parse, because the recreated class treated init=False (constant and padding) fields as __init__ parameters. They work now.

What's Changed

Full Changelog: v0.1.1...v0.1.2