Breaking Python's Speed Limits with FFI and asyncio
Want to build faster Python apps without ditching Python? This talk shares how we supercharged a Python Valkey/Redis client by combining the power of asyncio with native speed via FFI.
We’ll begin by discussing a common challenge in Python apps—how to achieve high performance, particularly for I/O-heavy or async workloads, without abandoning the ecosystem. Then, we’ll dive into how we built key parts of a Valkey client to take advantage of asyncio powerful concurrency model while using FFI to offload key performance-sensitive tasks to native code. We’ll show profiling before and after, walk through code samples, and share lessons on safely mixing Python with lower-level languages. Finally, we'll explore how these patterns can generalize to other async Python projects.