Files
json/single_include/nlohmann
Niels Lohmann a517b8ea8b Write a UBJSON, BJData or BSON string and its head in one reservation
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>
2026-10-22 09:28:59 +02:00
..