mirror of
https://github.com/nlohmann/json.git
synced 2026-10-22 22:08:55 +00:00
diff_unequal() allocated a vector with the values in target of the members of every object it diffed member by member. Objects with up to 16 members, which are most of them, now use space in the stack frame, and larger ones a vector as before. The storage is chosen once, when its size is reserved, so that adding and reading a value needs no check of which one is in use. diff() over the previous commit (instructions on macOS, Linux Ir GCC 13 / Clang 18): citm_catalog 21.5M -> 20.0M, 14.2M -> 13.5M / 14.2M -> 13.7M; twitter 12.0M -> 11.7M, 7.5M -> 7.3M / 7.5M -> 7.4M; canada 82.0M -> 81.5M. Signed-off-by: Niels Lohmann <mail@nlohmann.me>