mirror of
https://github.com/nlohmann/json.git
synced 2026-10-22 14:08:13 +00:00
The words of a string of 8 to 15 printable ASCII characters were each tested with the word-at-a-time arithmetic. With SSE2 or NEON, the two overlapping words are joined into one vector, which takes fewer operations to test; the stores are unchanged. Targets without either keep the word arithmetic. Apple M1, Apple clang, retired instructions per dump(), on top of the previous changes: jeopardy 451M -> 430M (-5 %) citm_catalog 5.60M -> 5.37M (-4 %) twitter 3.31M -> 3.25M (-2 %) keys and values of 1..40 characters -1 % Linux x86-64 (callgrind), gcc 13 / clang 18: jeopardy -15 % / -7 %, citm_catalog -6 % / -5 %, twitter -6 % / -4 %. Signed-off-by: Niels Lohmann <mail@nlohmann.me>