Files
json/single_include/nlohmann
Niels Lohmann ff2d59d3f1 Write the elements of a BJData ND-array in blocks
An ND-array annotation object is checked and then written from its _ArrayData_
in three passes. Every element went through basic_json::get<>() twice or three
times (the range check of the dry run, the conversion for the write) and
through write_number() with a std::array and a sink call of its own, with a
switch on the number kind for each.

The range check and the conversion read the value directly (the elements are
known to be integers or floats by then), and the real pass switches on the
number kind once and encodes its elements in blocks into space reserved from
the sink.

to_bjdata into a std::vector, instructions per call (Linux, GCC 13, thousands): an ND-array of 120000 doubles 14588 -> 9975, an ND-array of 120000 uint8 16583 -> 8790, an ND-array of 120000 doubles with use_size and use_type 14630 -> 10017.

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