mirror of
https://github.com/simdjson/simdjson
synced 2026-06-08 17:27:07 +00:00
2887e7432c
Two fixes to the ablation logic: 1. Fix incorrect branch hint in capacity_check() overflow detection (json_string_builder-inl.h:365): simdjson_likely was used on the overflow check `position + upcoming_bytes < position`, but overflow is rare so this should be simdjson_unlikely. The comment itself says "most of the time there is no overflow". This was causing the branch predictor to optimize for the wrong path. 2. Add missing ABLATION_NO_CONSTEVAL guard in extract_from() (json_builder.h:332): consteval_to_quoted_escaped was being used without an ablation guard, for consistency with all other call sites. Updated ablation results with both fixes: | Configuration | CITM (MB/s) | Impact | Twitter (MB/s) | Impact | |------------------|-------------|--------|----------------|--------| | Baseline | 3001.10 | - | 5651.89 | - | | NO_BRANCH_HINTS | 2443.67 | -19% | 4651.78 | -18% | | NO_SIMD_ESCAPING | 2904.34 | -3% | 1403.36 | -75% | | NO_CONSTEVAL | 1796.05 | -40% | 3542.77 | -37% |