httpcore
httpcore copied to clipboard
Use `asyncio` synchronization instead of `anyio`
Summary
First PR in series of optimizations to improve performance of httpcore
and even reach performance levels of aiohttp
.
Related discussion https://github.com/encode/httpx/issues/3215#issuecomment-2157885121
Previously:
With PR:
Request latency is more stable and the overall duration of the benchmark improves by 3.5x.
The difference diminishes when server latency increases over 100ms or so.
Checklist
- [x] I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
- [x] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
- [x] I've updated the documentation accordingly.