Files
json/single_include/nlohmann
Niels Lohmann 38536b6b4d Write the bytes of an unoptimized UBJSON and BON8 binary value in blocks
Without use_type, a binary value is an array of its bytes, and was written one
sink call per marker and per byte (UBJSON, BJData), or through the integer
ladder for each byte (BON8).

The bytes are now encoded in blocks into space reserved from the sink, by a
function that is not inlined. BON8 stores both bytes of an integer above 39
and keeps the second only if it is needed, so that the code does not branch on
the value.

Instructions per call for a 1 MB binary value (Linux, GCC 13, thousands): to_ubjson 34253 -> 9521, to_bjdata 34253 -> 9521, to_bon8 53088 -> 17333.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2026-10-22 09:28:51 +02:00
..