Commit 3a702ac
Improve
* Parse JSON in Rust
* Reuse key when decoding JSON
* Unmark resolved test
* Parse null/true/false directly in call_scan_once
Parse JSON constants (null, true, false) directly in Rust within
call_scan_once() instead of falling back to Python scan_once.
This reduces Python-Rust boundary crossings for array/object values.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Parse numbers directly in call_scan_once
Parse JSON numbers starting with digits (0-9) directly in Rust within
call_scan_once() by reusing the existing parse_number() method.
This reduces Python-Rust boundary crossings for array/object values.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Parse NaN/Infinity/-Infinity in call_scan_once
Parse special JSON constants (NaN, Infinity, -Infinity) and negative
numbers directly in Rust within call_scan_once(). This handles:
- 'N' -> NaN via parse_constant callback
- 'I' -> Infinity via parse_constant callback
- '-' -> -Infinity or negative numbers via parse_constant/parse_number
This reduces Python-Rust boundary crossings for array/object values.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Correct wrong index access
* Leave more flame span
* Refactor json scanstring with byte index
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>json.loads performance (#6704)1 parent c5deb74 commit 3a702ac
File tree
3 files changed
+587
-73
lines changed- Lib/test/test_json
- crates/stdlib/src
- json
3 files changed
+587
-73
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
142 | | - | |
143 | 141 | | |
144 | 142 | | |
145 | 143 | | |
| |||
0 commit comments