Leviathan redefines speed in Python's asyncio with its ultra-fast event loop, engineered through Zig. This easy-to-integrate solution not only replaces the default event loop seamlessly but also significantly enhances performance and minimizes latency, making it ideal for high-demand applications.
Leviathan is an ultra-fast event loop for Python's asyncio framework, designed to enhance the performance of asynchronous programming by leveraging the power of Zig. As a drop-in replacement for the default event loop, Leviathan ensures seamless compatibility with existing Python projects while delivering optimized performance.
Leviathan can be used simply by replacing the default event loop in your asyncio code. Here’s a brief example:
from leviathan import Loop
import asyncio
async def main():
print("Hello from Leviathan!")
await asyncio.sleep(1)
print("Goodbye from Leviathan!")
loop = Loop()
try:
loop.run_until_complete(main())
finally:
loop.close()
Initial benchmarks demonstrate Leviathan's superior speed compared to conventional event loops. For a visual comparison, refer to the performance chart below:

For a comprehensive overview of benchmarks and further details, please refer to More benchmarks and details.
Leviathan is currently under active development, and certain features, such as complete networking support, are yet to be fully implemented. Keep this in mind when integrating into larger projects.
No comments yet.
Sign in to be the first to comment.