Niels Lohmann
4fe670b5f4
json_view: decode chains of unicode escapes in a loop ( #5969 )
...
After the first \uXXXX escape of a string, slow_string() now decodes the
escapes that follow it directly, while the next six bytes are \u and four hex
digits that are not a surrogate, instead of going round its main loop for each
of them (that is how Python's json.dumps writes non-ASCII text by default).
A surrogate, a bad digit, or fewer than six bytes leave the position at the
backslash: the main loop handles them as before and reports the same error at
the same position.
twitterescaped.json (simdjson-data, 549 KB, 33,036 escapes), json_document::parse(),
A/B in one binary, 6 code layouts, time after / before:
- Apple M1 Max, Apple clang 21: 0.897
- x86-64 Haswell, GCC 16.2: 0.907
- x86-64 Haswell, Clang 23: 0.910
The other files of the benchmark set (twitter, citm_catalog, canada, gsoc-2018,
apache_builds, instruments, tree-pretty, github_events, random, update-center,
semanticscholar-corpus, twitter_timeline) stay within the noise of each machine.
New test: chains of every length from 1 to 40 of escapes that give one, two,
and three bytes of UTF-8, followed by the end of the string, text, escapes,
surrogates, bad digits, and cut in every place, in keys and in values, against
json::parse().
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
2026-10-31 13:54:02 +01:00
..
2026-10-17 08:28:28 +02:00
2026-10-11 08:24:31 +02:00
2026-10-11 08:24:31 +02:00
2026-10-14 17:38:36 +02:00
2026-10-15 20:04:57 +02:00
2026-01-01 20:00:39 +01:00
2026-10-25 12:07:51 +01:00
2026-10-15 20:04:57 +02:00
2026-10-15 20:04:57 +02:00
2026-10-15 20:04:57 +02:00
2026-10-15 20:04:57 +02:00
2026-10-25 12:07:51 +01:00
2026-10-15 20:04:57 +02:00
2026-10-15 20:04:57 +02:00
2026-10-15 20:04:57 +02:00
2026-10-21 10:21:30 +02:00
2026-01-01 20:00:39 +01:00
2026-10-01 07:33:07 +02:00
2026-10-01 07:33:07 +02:00
2026-10-11 08:21:13 +02:00
2026-09-16 20:15:46 +02:00
2026-10-06 22:53:03 +02:00
2026-10-01 07:33:07 +02:00
2026-10-15 20:01:20 +02:00
2026-10-08 16:11:16 +02:00
2026-10-27 17:15:55 +01:00
2026-10-01 07:37:47 +02:00
2026-10-14 17:38:37 +02:00
2026-10-09 17:05:36 +02:00
2026-10-04 17:18:19 +02:00
2026-10-23 06:52:58 +02:00
2026-10-17 08:28:28 +02:00
2026-10-17 08:28:28 +02:00
2026-10-26 18:25:46 +01:00
2026-10-11 08:22:00 +02:00
2026-10-07 07:39:05 +02:00
2026-10-28 07:11:04 +01:00
2026-09-16 20:15:46 +02:00
2026-10-01 07:37:47 +02:00
2026-10-26 18:25:44 +01:00
2026-09-27 14:19:22 +02:00
2026-01-01 20:00:39 +01:00
2026-10-25 06:17:50 +01:00
2026-10-30 09:56:06 +01:00
2026-10-15 20:01:21 +02:00
2026-01-01 20:00:39 +01:00
2026-10-25 06:17:51 +01:00
2026-10-16 19:16:21 +02:00
2026-09-11 08:22:50 +02:00
2026-10-04 17:18:19 +02:00
2026-10-06 07:22:55 +02:00
2026-10-21 08:36:31 +00:00
2026-10-09 16:56:14 +02:00
2026-10-13 17:16:52 +02:00
2026-10-11 08:24:31 +02:00
2026-10-11 08:24:31 +02:00
2026-10-11 08:24:31 +02:00
2026-10-11 08:24:31 +02:00
2026-10-11 08:24:31 +02:00
2026-10-23 06:52:58 +02:00
2026-10-10 00:05:02 +02:00
2026-10-08 16:11:16 +02:00
2026-10-06 07:22:55 +02:00
2026-10-13 17:16:52 +02:00
2026-10-25 12:07:51 +01:00
2026-10-07 16:37:19 +02:00
2026-10-16 19:16:21 +02:00
2026-09-30 20:53:56 +02:00
2026-10-25 12:07:51 +01:00
2026-09-30 20:07:06 +02:00
2026-10-25 12:07:51 +01:00
2026-10-04 17:54:05 +02:00
2026-10-04 17:54:05 +02:00
2026-10-25 12:07:51 +01:00
2026-10-19 22:00:58 +02:00
2026-10-25 12:07:51 +01:00
2026-10-20 22:24:09 +02:00
2026-10-25 12:07:51 +01:00
2026-01-01 20:00:39 +01:00
2026-09-09 09:52:58 +02:00
2026-10-04 22:11:34 +02:00
2026-10-16 19:16:21 +02:00
2026-10-01 07:33:07 +02:00
2026-01-01 20:00:39 +01:00
2026-10-28 20:23:55 +01:00
2026-10-28 20:23:55 +01:00
2026-10-31 13:54:02 +01:00
2026-10-30 15:19:42 +01:00
2026-10-30 15:19:42 +01:00
2026-10-28 19:46:28 +01:00
2026-10-30 15:17:55 +01:00
2026-10-28 20:24:49 +01:00
2026-10-30 15:19:42 +01:00
2026-10-21 10:21:27 +02:00
2026-10-28 22:08:55 +01:00
2026-10-28 20:24:49 +01:00
2026-10-17 08:28:28 +02:00
2026-10-17 08:28:28 +02:00
2026-10-17 08:28:28 +02:00
2026-10-14 17:38:36 +02:00
2026-10-12 09:33:43 +02:00
2026-10-26 17:11:55 +01:00
2026-01-01 20:00:39 +01:00
2026-10-04 17:18:19 +02:00
2026-10-06 22:53:03 +02:00
2026-10-21 08:36:31 +00:00
2026-10-21 08:36:31 +00:00
2026-10-25 12:07:51 +01:00
2026-10-25 12:07:51 +01:00
2026-09-09 09:48:17 +02:00
2026-09-16 20:15:46 +02:00
2026-10-02 17:25:17 +02:00
2026-10-09 16:56:14 +02:00
2026-10-24 07:41:21 +02:00
2026-10-04 17:18:19 +02:00
2026-10-27 14:31:31 +01:00
2026-10-19 22:00:58 +02:00
2026-10-19 22:00:31 +02:00
2026-10-01 07:33:07 +02:00
2026-01-01 20:00:39 +01:00
2026-10-27 20:31:53 +01:00
2026-10-25 12:07:51 +01:00
2026-10-25 12:07:51 +01:00
2026-10-15 20:04:42 +02:00
2026-10-23 06:52:41 +02:00
2026-10-25 12:07:51 +01:00
2026-10-22 20:22:53 +02:00
2026-10-23 06:48:00 +02:00
2026-10-16 19:16:21 +02:00
2026-10-16 19:16:21 +02:00
2026-10-21 20:14:59 +02:00
2026-10-15 22:42:46 +02:00
2026-10-04 11:50:42 +02:00
2026-10-26 18:25:45 +01:00
2026-01-01 20:00:39 +01:00
2026-09-25 20:44:30 +02:00
2026-10-06 22:33:29 +02:00
2026-10-07 19:17:57 +02:00
2026-10-01 07:37:47 +02:00
2026-01-01 20:00:39 +01:00
2026-10-04 17:18:19 +02:00
2026-09-30 22:49:24 +02:00
2026-10-01 07:37:47 +02:00