skillfed

aiofastnet

Fast transport/protocol networking for asyncio

aiofastnet v1.1.0 139.1K downloads/30d#11,306 on PyPI25
License unclear Active released

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 aiofastnet

uv

uv add aiofastnet

poetry

poetry add aiofastnet

Installing 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

Development Status :: 5 - Production/StableFramework :: AsyncIOIntended Audience :: DevelopersOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIXProgramming Language :: CythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonTopic :: System :: Networking

Tags

asyncio performance optimizationfaster asyncio networkingSSL TLS accelerationasyncio transport replacementhigh-performance asyncioasyncio loop optimizationnetwork throughput boost
asyncio-performancessl-optimizationdrop-in-overlay

More Networking packages