aiofastnet
Fast transport/protocol networking for asyncio
What it is and what it does
aiofastnet is a C/Cython reimplementation of asyncio's transport and protocol layer that intercepts and accelerates low-level networking operations. It works as a drop-in overlay on top of existing asyncio, uvloop, or winloop event loops—you install it and call install_policy(), loop_factory(), or patch_loop() to enable it, then all libraries using asyncio networking automatically benefit from the faster implementation.
The package replaces asyncio's internal methods for connection creation, socket operations, and TLS handling with optimized versions that reduce overhead on long-lived connections. According to the description, it achieves up to 2.7x speedup over standard asyncio and up to 1.6x over uvloop for TLS workloads. It also supports Kernel TLS on Linux and provides safer buffer handling for transport write operations, avoiding data corruption if application code modifies buffers after write() returns.
Use it for:
- Accelerate aiohttp, asyncpg, websockets, or uvicorn applications without changing application code.
- Optimize SSL/TLS-heavy workloads such as secure HTTP or database connections where transport overhead dominates.
- Enable efficient FileResponse sendfile over SSL connections in aiohttp using Kernel TLS on Linux.
- Improve throughput in library code (WebSocket, HTTP, RPC, proxy, database) by patching the event loop once.
- Run free-threaded Python builds with multiple event loops across threads and scale networking performance.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
aiofastnet replaces asyncio's transport and protocol layer with optimized C/Cython implementations to accelerate networking operations, especially SSL/TLS connections, while remaining compatible with standard asyncio, uvloop, and winloop event loops.
Yes, with conditions. aiofastnet is actively maintained, has no known vulnerabilities, and offers measurable performance gains for asyncio-based applications—especially those using SSL or long-lived connections. However, verify the license terms before use, as the metadata does not declare a license. If you run asyncio networking workloads (aiohttp, asyncpg, websockets, uvicorn), installing it is a low-friction way to gain performance without refactoring.
Install
aiofastnet on PyPI
pip
pip install aiofastnetuv
uv add aiofastnetpoetry
poetry add aiofastnetInstalling aiofastnet
Before you install
Medium install friction due to compiled wheels across multiple platforms and Python versions (3.9–3.14). Active maintenance with a release 1 day old and recent commits; dependency on exceptiongroup is minimal.
License in practice
License status is unclear—no SPDX identifier or raw license text is available in the package metadata. Verify the actual license before use in proprietary or restricted contexts.
Quickstart
import asyncio
import aiofastnet
async def main():
# Use aiofastnet with a loop factory
pass
asyncio.run(main(), loop_factory=aiofastnet.loop_factory())
Requires Python 3.9 or greater. Compiled wheels are provided for common platforms; installation on unsupported architectures may require building from source.
Verify before relying
- Actual license terms and restrictions—metadata lists no SPDX or raw license text.
- Whether aiofastnet's performance gains hold across all workload types or primarily for SSL-heavy scenarios.
- Compatibility guarantees with future Python 3.14+ releases and free-threaded builds beyond the stated support.
Package facts
| License | not declared (unclear) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 1 — exceptiongroup |
| Maintenance | actively maintained — 1 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 139,147/month — #11,306 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: aiofastnet-1.1.0-cp310-cp310-macosx_10_9_x86_64.whl; aiofastnet-1.1.0-cp310-cp310-macosx_11_0_arm64.whl; aiofastnet-1.1.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; aiofastnet-1.1.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; aiofastnet-1.1.0-cp310-cp310-musllinux_1_2_aarch64.whl; aiofastnet-1.1.0-cp310-cp310-musllinux_1_2_x86_64.whl; aiofastnet-1.1.0-cp310-cp310-win32.whl; aiofastnet-1.1.0-cp310-cp310-win_amd64.whl; aiofastnet-1.1.0-cp310-cp310-win_arm64.whl; aiofastnet-1.1.0-cp311-cp311-macosx_10_9_x86_64.whl; aiofastnet-1.1.0-cp311-cp311-macosx_11_0_arm64.whl; aiofastnet-1.1.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; aiofastnet-1.1.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; aiofastnet-1.1.0-cp311-cp311-musllinux_1_2_aarch64.whl; aiofastnet-1.1.0-cp311-cp311-musllinux_1_2_x86_64.whl; aiofastnet-1.1.0-cp311-cp311-win32.whl; aiofastnet-1.1.0-cp311-cp311-win_amd64.whl; aiofastnet-1.1.0-cp311-cp311-win_arm64.whl; aiofastnet-1.1.0-cp312-cp312-macosx_10_13_x86_64.whl; aiofastnet-1.1.0-cp312-cp312-macosx_11_0_arm64.whl
Keywords: asyncio
Tags
More Networking packages
h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
psutilpsutil retrieves real-time information about…
permissive · top 1,000 on PyPI
pyOpenSSLpyOpenSSL wraps OpenSSL's SSL/TLS functionality…
permissive · top 1,000 on PyPI
uvloopuvloop is a drop-in replacement for Python's…
permissive · top 1,000 on PyPI
execnetexecnet lets you spawn and communicate with…
permissive · top 1,000 on PyPI
pyzmqPyZMQ provides Python bindings for ZeroMQ…
permissive · top 1,000 on PyPI
winloopWinloop is a Windows-compatible alternative to…
permissive · top 15,000 on PyPI
aioserialProvides async/await serial port I/O using…
copyleft · top 15,000 on PyPI
asyncio-dgramProvides simple async/await wrappers for UDP…
permissive · top 15,000 on PyPI
velbus-aioAn asyncio-based Python library for controlling…
permissive · top 15,000 on PyPI
aiohttp-fast-zlibReplaces aiohttp's default zlib compression…
permissive · top 5,000 on PyPI
kubernetes-asyncioAsynchronous Python client for the Kubernetes…
permissive · top 5,000 on PyPI
nest-asyncioPatches asyncio to allow nested event loops,…
permissive · top 1,000 on PyPI
nest-asyncio2Patches asyncio to allow nested event loops,…
permissive · top 1,000 on PyPI
aiohttp-zlib-ngReplaces aiohttp's default zlib compression…
permissive · top 15,000 on PyPI