Skip cookie extraction without Set-Cookie - #1107
Conversation
|
Docs preview: https://fbc99cb7-httpx2-docs.pydantic.workers.dev |
Merging this PR will not alter performance
Comparing Footnotes
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5d3dfd3464
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Summary
Skip
CookieJar.extract_cookies()when a response has noSet-Cookieheader.The current path constructs urllib request/response compatibility wrappers and an email message for every response, even though most responses cannot update the cookie jar. Checking the already-parsed response headers first avoids that work while preserving cookie handling when
Set-Cookieis present.Related to #827.
Benchmark
The #827 localhost benchmark uses 100 requests at concurrency 20 after a 100-request warmup. Median across three 10-round runs:
mainThis is an approximately 8% improvement for HTTPX2 in this workload.
Validation
Set-Cookie.Set-Cookiecoverage continues to pass.git diff --checkpass.