Python JSON, Binary, and AOT Benchmarks — September 2026#
This report provides reproducible performance evidence for Python JSON data-binding, binary serialization, and Ahead-of-Time (AOT) compiled native extensions. Every measurement is backed by committed harnesses, identical semantic model checks, and raw sample logs.
This suite compares PolyXML native JSON APIs (polyxml.loads_json, dumps_json, JsonParser, JsonSerializer) against xsdata JSON data-binding on the exact same Python dataclass models and identical JSON payloads.
2. Binary Serialization: PolyXML vs pickle and cloudpickle#
This suite compares PolyXML Binary (polyxml.dumps_binary, loads_binary based on MessagePack) with standard library pickle (protocol 5 with C accelerator) and cloudpickle across direct uncompressed and LZ4 compressed modes.
3. Real-World Ahead-of-Time (AOT) PyO3 C-Extension vs Standard Dataclass#
This suite evaluates the performance difference between PolyXML's standard Python @dataclass runtime (polyxml.deserialize, serialize) and Ahead-of-Time compiled PyO3 native extensions (--backend aot).
Workload 1: Real-world USAF UCI v2.5 command and control entity telemetry (benchmarks/python-aot/data/uci_entity.xml, 1,510 bytes XML). Models: uci_entity_core.EntityMt dataclass vs uci_aot.EntityMt PyO3 extension.
PolyXML native JSON deserialization is 9.2x to 15.5x faster than xsdata, and serialization is 8.4x to 9.3x faster, while operating on the exact same dataclass models.
Binary Serialization:
For small and nested objects, PolyXML MessagePack decoding is 2.3x faster than pickle (3.6 μs vs 8.2 μs for Sensor; 16.7 μs vs 27.3 μs for Order) and creates smaller payloads (118 B vs 185 B).
For large homogeneous 100-item batches, pickle's specialized C array packing achieves a smaller uncompressed payload (7.2 KB vs 11.8 KB) and slightly faster decoding (275.2 μs vs 331.0 μs). With LZ4 compression, PolyXML achieves smaller payloads (1,937 B vs 1,986 B).
Ahead-of-Time (AOT) C-Extensions:
On production USAF UCI XML telemetry messages, AOT PyO3 native extensions parse XML in 7.44 μs (134,336 ops/sec, 193.5 MB/s), an 8.39x speedup over runtime dataclass reflection.
Per-packet latency is measured at 7.44 μs (not sub-microsecond). While extraordinarily fast, we strictly avoid rounding or exaggeration.