Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling URL.origin() is expensive when we cannot avoid it in the cookie jar #1174

Closed
bdraco opened this issue Oct 5, 2024 · 0 comments · Fixed by #1175
Closed

Calling URL.origin() is expensive when we cannot avoid it in the cookie jar #1174

bdraco opened this issue Oct 5, 2024 · 0 comments · Fixed by #1175

Comments

@bdraco
Copy link
Member

bdraco commented Oct 5, 2024

          > Open PRs that probably resolve these performance issues: aio-libs/aiohttp#7784 aio-libs/aiohttp#7777 aio-libs/aiohttp#7790

I see. But they do not eliminate the need to call URL.origin(), which is also expensive, even when the jar is empty. Would you think that my suggestion is a good idea? If so, I can open a PR.

Originally posted by @Rongronggg9 in aio-libs/aiohttp#7583 (comment)

@bdraco bdraco transferred this issue from aio-libs/aiohttp Oct 5, 2024
bdraco added a commit that referenced this issue Oct 5, 2024
- Avoid rebuilding the netloc if there is no auth
- Cache the origin so we only build it once as
  aiohttp will call `.origin()` often on the same
  URL object when auth is enabled

fixes #1174
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant