Repository navigation
Skip buffered multipart line endings - #373
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 25.81%1 warning
Performance Changes
Tip Curious why performance improved? Comment Comparing |
Evaluate the remaining multipart proposal from @deadstrobe5 in issue #365. Consume buffered CRLF sequences directly after header values, at the end of headers, and after between-part boundaries, instead of visiting each intermediate parser state. Split or invalid line endings keep the existing validation paths.
Add a public-API regression test that checks callback order and data across every two-chunk split and byte-by-byte writes, including empty header values and a headerless part. No workflow changes are included.
The earlier local evaluation improved form parsing but showed an approximately 5% slower 8 MB upload case. This PR uses the existing CodSpeed benchmarks to evaluate that tradeoff against current
main; no across-the-board speedup is assumed.Validation on Python 3.13.18:
scripts/check,scripts/test --strict-config --strict-markers(188 tests, 100% coverage), andscripts/renamepass.0f08970epasses with the candidate installed: 1,419 passed, 2 expected failures, 100% line and branch coverage.Session:
pi --session 01a1e0a2-78a9-7473-86ce-b992bd92cf74