Niels Lohmann
ecf9df7c45
Convert the floats of json_view from the digit layout
...
The parser records where the integer digits, the fraction digits, and the
exponent of a float token are. For floats and doubles with at most 19
digits, the value is now read from that layout: the digits eight at a time,
without scanning the token, and rounded by the library's conversion core
(detail::decimal_to_float(): Clinger's fast path where both operands are
exact, else the Eisel-Lemire algorithm, which needs no fallback for up to 19
digits). It rounds correctly, so the values are those of parse(); other
tokens and types keep the library's conversion of the whole token.
get<double>(), materialize(), dump(), and comparisons use it. Traversing
canada.json (111,000 floats, every number converted): 0.95 -> 1.29 GB/s.
Tests add tokens around the limits (19 and 20 digits, 2^53, 10^22, and
those of float) to the bit-for-bit comparison with parse().
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
2026-09-30 21:01:51 +02:00
..
2026-09-30 20:19:11 +02:00
2026-01-01 20:00:39 +01:00
2026-09-25 08:29:02 +02:00
2026-09-27 16:56:21 +02:00
2026-09-24 17:02:57 +02:00
2026-09-24 17:02:57 +02:00
2026-09-30 20:58:31 +02:00
2026-09-24 17:02:57 +02:00
2026-09-24 17:02:57 +02:00
2026-09-25 08:29:02 +02:00
2026-01-01 20:00:39 +01:00
2026-09-25 08:29:02 +02:00
2026-09-16 20:15:46 +02:00
2026-09-27 14:28:38 +02:00
2026-07-31 18:04:30 +02:00
2026-07-08 16:40:58 +02:00
2026-09-30 20:08:00 +02:00
2026-09-30 20:13:31 +02:00
2026-01-01 20:00:39 +01:00
2026-09-27 16:56:21 +02:00
2026-09-27 16:56:21 +02:00
2026-09-27 14:28:38 +02:00
2026-09-27 16:56:21 +02:00
2026-09-24 17:05:37 +02:00
2026-09-30 20:07:41 +02:00
2026-09-16 20:15:46 +02:00
2026-01-01 20:00:39 +01:00
2026-09-28 17:51:07 +02:00
2026-09-27 14:19:22 +02:00
2026-01-01 20:00:39 +01:00
2026-09-30 20:19:12 +02:00
2026-09-30 20:07:48 +02:00
2026-09-30 20:07:56 +02:00
2026-01-01 20:00:39 +01:00
2026-09-30 20:07:52 +02:00
2026-01-01 20:00:39 +01:00
2026-09-11 08:22:50 +02:00
2026-09-30 20:07:29 +02:00
2026-09-30 20:07:16 +02:00
2026-09-30 20:07:24 +02:00
2026-09-27 16:56:21 +02:00
2026-09-27 16:56:21 +02:00
2026-09-30 20:07:33 +02:00
2026-09-27 14:19:22 +02:00
2026-09-30 20:13:34 +02:00
2026-09-30 20:06:34 +02:00
2026-09-30 20:07:06 +02:00
2026-09-30 20:07:45 +02:00
2026-09-27 16:56:21 +02:00
2026-07-02 15:59:36 +02:00
2026-09-24 17:12:02 +02:00
2026-01-01 20:00:39 +01:00
2026-09-09 09:52:58 +02:00
2026-09-09 09:52:58 +02:00
2026-01-01 20:00:39 +01:00
2026-07-09 20:38:39 +02:00
2026-01-01 20:00:39 +01:00
2026-09-30 20:07:10 +02:00
2026-09-30 20:06:59 +02:00
2026-09-30 20:58:49 +02:00
2026-09-30 20:57:44 +02:00
2026-09-30 21:01:51 +02:00
2026-09-27 14:28:38 +02:00
2026-09-30 20:19:11 +02:00
2026-09-27 14:19:22 +02:00
2026-01-01 20:00:39 +01:00
2026-09-30 20:07:16 +02:00
2026-09-30 20:07:19 +02:00
2026-09-30 20:08:17 +02:00
2026-09-16 20:15:46 +02:00
2026-09-09 09:48:17 +02:00
2026-09-16 20:15:46 +02:00
2026-01-01 20:00:39 +01:00
2026-09-27 16:56:21 +02:00
2026-09-24 17:01:15 +02:00
2026-09-30 20:06:34 +02:00
2026-01-01 20:00:39 +01:00
2026-09-30 20:07:33 +02:00
2026-01-01 20:00:39 +01:00
2026-01-01 20:00:39 +01:00
2026-09-28 17:51:07 +02:00
2026-09-27 16:56:21 +02:00
2026-09-27 16:56:21 +02:00
2026-09-27 14:19:22 +02:00
2026-09-27 14:19:22 +02:00
2026-01-01 20:00:39 +01:00
2026-01-01 20:00:39 +01:00
2026-08-03 08:35:53 +02:00
2026-09-27 14:28:38 +02:00
2026-01-01 20:00:39 +01:00
2026-09-25 20:44:30 +02:00
2026-01-01 20:00:39 +01:00
2026-09-09 09:50:39 +02:00
2026-09-09 09:50:39 +02:00
2026-09-16 20:16:43 +02:00
2026-09-16 20:16:43 +02:00
2026-09-16 20:16:43 +02:00
2026-09-10 17:20:48 +02:00
2026-01-01 20:00:39 +01:00
2026-09-27 14:19:22 +02:00
2026-01-01 20:00:39 +01:00