Files
simdjson-simdjson/include/simdjson
Francisco Geiman Thiesen 32b52e3f34 builder: coalesce per-field separator+key+colon into one constexpr write (#2698)
Each non-first field in a reflection-driven struct serialization was
emitting three separate string_builder::append calls (',', "\"key\"", ':'),
each going through capacity_check + a small write. Combine them into a
single compile-time string per field so each field does one capacity_check
and one memcpy. Same pattern fixed in atom(), append(), and extract_from().

Measured under clang-p2996 -O3 -DNDEBUG -freflection -std=c++26
(median of 5 contemporaneous runs, output byte-identical to baseline):

  CITM serialization (496682 bytes):
    simdjson_reuse_buffer:        3192 -> 3673 MB/s  (+15.1%)
    simdjson_static_reflection:   3014 -> 3443 MB/s  (+14.2%)
    simdjson_to:                  2717 -> 3234 MB/s  (+19.0%)
    simdjson_to_reuse:            2836 -> 3226 MB/s  (+13.7%)

  Twitter serialization (81927 bytes):
    simdjson_reuse_buffer:        6637 -> 7162 MB/s   (+7.9%)
    simdjson_static_reflection:   5527 -> 5915 MB/s   (+7.0%)
    simdjson_to:                  5070 -> 5350 MB/s   (+5.5%)
    simdjson_to_reuse:            4976 -> 5303 MB/s   (+6.6%)

  extract_from (out-of-tree micro-bench, 100 records per call):
    User 4-of-9 fields:           1833 -> 1888 MB/s   (+3.0%)
    Status 3-of-6 fields:         4286 -> 4334 MB/s   (+1.1%)

Parsing benchmarks unchanged. tests/builder/static_reflection_comprehensive_tests
still passes (round-trip through extract_from / extract_into is verified).
2026-04-30 21:02:41 -04:00
..
2026-01-21 10:13:50 -05:00
2026-01-21 10:13:50 -05:00
2026-01-21 10:13:50 -05:00
2026-01-21 10:13:50 -05:00
2026-01-21 10:13:50 -05:00
2026-01-21 10:13:50 -05:00
2026-01-21 10:13:50 -05:00
2026-01-21 10:13:50 -05:00
2026-01-21 10:13:50 -05:00
2023-07-16 19:18:58 -07:00
2026-04-11 14:16:43 -04:00
2026-01-21 10:13:50 -05:00
2025-09-21 08:13:48 -06:00
2025-09-21 08:13:48 -06:00
2023-07-16 19:18:58 -07:00
2023-07-16 19:18:58 -07:00
2023-07-16 19:18:58 -07:00
2025-07-14 15:55:00 -04:00
2023-07-14 20:05:05 -07:00
2023-07-16 19:18:58 -07:00
2026-01-21 10:13:50 -05:00
2026-04-03 15:26:12 -04:00
2024-02-23 16:50:55 -05:00
2023-07-16 19:18:58 -07:00