Uh oh!
There was an error while loading. Please reload this page.
Use AnyIO with fast_acquire synchronization - #953
Conversation
a8d7461 to
e7d8601Comparegraingert
commented
Mar 27, 2025
nice this looks good! This feature was added to anyio specifically for httpcore, so I'm going to merge it even though I'm the only review |
lovelydinosaur
commented
Mar 27, 2025
@graingert No. Please don't do that on this PR. This was my latest comment regarding this... #922 (comment) Here's a comment that'd make me wary of jumping onto |
This reverts commit 973cbdd.
graingert
commented
Mar 27, 2025
Happy for a revert, does #927 remove a lock on the async code path and therefore make this PR redundant? |
lovelydinosaur
commented
Mar 27, 2025
I'm not talking about #927 or directing my attention there at the moment. |
lovelydinosaur
commented
Mar 27, 2025
Revert PR at #1002. |
Nivyaal-zenity
commented
Mar 30, 2025
When will the tag related to this change here and on httpx will be relaesed? |
ofek
commented
Apr 19, 2025
I'm confused about what happened here; what was the technical issue? |
zanieb
commented
Apr 19, 2025
ofek
commented
Apr 19, 2025
Ah I missed the second comment, thanks! I don't do enough |
Can you explain this to me, as it didn't make a lick of sense to me? Was this about |
lovelydinosaur
commented
Apr 26, 2025
@agronholm So. The priority at the time was bumping a release from 1.0.7 to 1.0.8 in order to resolve #1005. Mixing in other concerns introduces risk, rather than just prioritising the necessary fix for Python 3.14.0a6. Also I've been doing some background work on a significantly simplified implementation. I've got a connection pool approach that's smaller, more readable, and easier to reason about. It also happens to result in faster & more stable response characteristics under load. (significant improvement vs. current httpx, marginal improvement vs. aiohttpx) I'm not ready to share the work publicly yet, tho will update shortly. |
agronholm
commented
Apr 26, 2025
OK, thanks for the quick response. I was previously left with the impression that you had reservations about |
lovelydinosaur
commented
Apr 26, 2025
I don't really know enough about (Incidentally, thanks so much for your work on |
agronholm
commented
Apr 26, 2025
Yeah, so the summary is that with |
Reinstates encode/httpcore#953 which was reverted in encode/httpcore#1002 for process reasons, not technical ones. fast_acquire=True skips an unnecessary event loop yield on uncontended lock acquires, eliminating two round-trips per request through the connection pool. Requires anyio >= 4.5.0 (bumped in pyproject.toml).
Reinstates encode/httpcore#953 which was reverted in encode/httpcore#1002 for process reasons, not technical ones. fast_acquire=True skips an unnecessary event loop yield on uncontended lock acquires, eliminating two round-trips per request through the connection pool. Requires anyio >= 4.5.0 (bumped in pyproject.toml).
Summary
Related to agronholm/anyio#761 and #922 (comment)
This uses AnyIOs
fast_acquire-mode in its synchronization primitives (instead of replacing AnyIO with vanilla asyncio). Which gives a big performance boost (see above comment lint).Checklist