mirror of
https://github.com/nlohmann/json.git
synced 2026-10-22 22:08:55 +00:00
Same as for CBOR and MessagePack: with the default error handler (keep) a string or object key of up to 253 characters (UBJSON, BJData: the `S` marker, the length as `i` or `U` and one byte, and the characters), or a BSON string entry that fits the reservation limit (type, name, length, characters and null byte), is written into space reserved from the sink in one go, instead of by four to six sink writes, a string_t for the error handler, and a call of sanitize_utf8_for_write(). The name of a BSON entry is copied with the short- string copy of the sinks. Instructions per call (Linux, GCC 13, thousands), to_ubjson: 20000 small objects 28241 -> 20981, twitter 5175 -> 3867, citm_catalog 10681 -> 8857; to_bjdata: 20000 small objects 28261 -> 21001, twitter 5181 -> 3873. Signed-off-by: Niels Lohmann <mail@nlohmann.me>