Repository navigation
Reuse query-string separators and start fields directly - #372
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Merging this PR will improve performance by 21.52%1 warning
Performance Changes
Tip Curious why performance improved? Comment Comparing |
Evaluate the query-string proposal from @deadstrobe5 in issue #365. Reuse the
&position found while scanning a field name, and start the next field directly when its first byte is already available. Duplicate and trailing separators keep the existing path.Add regression tests for field-start events across every two-chunk split and byte-by-byte writes, and for
max_sizeending at a separator. Both tests also pass against unchangedmain.Local wall-clock timings on CPython 3.13.18, macOS arm64, for the existing large query-string input: 41.3 to 30.7 µs with no-op callbacks, and 54.7 to 43.1 µs with append callbacks. These are local results, not a confirmed portable speedup; the existing CodSpeed benchmark will evaluate the change in CI. No multipart or workflow changes are included.
Validation:
scripts/check,scripts/test --strict-config --strict-markers(187 tests, 100% coverage), andscripts/renamepass on Python 3.13.18. An additional 39,360 differential cases againstmainmatched callbacks, consumed bytes, and errors across chunking, strict parsing, and size limits.Session:
pi --session 01a1e0a2-78a9-7473-86ce-b992bd92cf74