#serialization
2 posts tagged #serialization.
A 40-line JSON serializer with reflection
Corrected on 6 October 2026: there is no reflect_json library, and the speed figures in the first version were not measured with a method I can show. The post walks a struct and emits JSON in about fifty lines, with no macros and no external codegen; the corrected measurement is in the Runtime cost section.
simdjson meets reflection: sb << my_struct at 6.8 GB/s
simdjson now ships a C++26 reflection backend: define SIMDJSON_STATIC_REFLECTION, and sb << my_struct serializes any aggregate at SIMD speed. The CITM Catalog benchmark hits 6.8 GB/s. Combined with P3394 annotations for rename/skip, this is the production JSON path the reflection series has been building toward.