mirror of
https://github.com/nlohmann/json.git
synced 2026-10-22 14:08:13 +00:00
The string writers kept the string_t that holds a sanitized copy for the other error handlers in the function that also has the fast path for the default one, so that every string paid for its construction check, a stack frame with a stack protector under GCC, and the registers saved for the slow path. The slow path is now a function of its own that the fast path does not call. Instructions per call (Linux, GCC 13, thousands), to_ubjson: twitter 3867 -> 3274, 20000 small objects 20981 -> 17901; to_bjdata: twitter 3873 -> 3281, 20000 small objects 21001 -> 17921; to_msgpack: 20000 small objects 18342 -> 15922. Signed-off-by: Niels Lohmann <mail@nlohmann.me>