Closed tree4096 closed 3 months ago
@tree4096
Sorry for getting back to you so late. I took some time off from coding.
Its great that you have created an asyncio
wrapper.
This library is meant to be low level and for developers(such as yourself) to write their own library on top of it.
That being said soon going to be updating this project to cython. Also planning on creating user-friendly library where you can do:
async with File(path) as file:
await file.read()
edit: check out https://github.com/YoSTEALTH/Shakti
Hello,
Thank you for your great library and I'm looking forward to new Cython version.
I'm interested in io_uring, and now I've been writing a asyncio wrapper for this library and file operation API. https://github.com/tree4096/uring_file (forked from https://github.com/qweeze/uring_file)
Can I contribute my code on your library or community of io_uring developers?
After implemeting some optimization, I achieved relatively better performance than other async file I/O libs such as aiofiles, aiofile, and anyio. The results of performance test as below.
Test code
https://github.com/tree4096/uring_file/blob/master/performance_test.py
Writing Test
Reading Test
*aiofile has Linux AIO mode, but does not work on Ubuntu due to the bug. So it run on C threading mode.
Environment
OS: Ubuntu 20.04.4 LTS on WSL2 Kernel ver.: 5.10.102.1-microsoft-standard-WSL2 CPU: AMD Ryzen 7 5800U SSD: MTFDHBA1T0TDV-1AZ1AABHA Python ver.: 3.10.5
My library provides simple and efficient APIs to access the io_uring like a database session and the file I/O APIs are written over them. Here is the sample code.
The SQEs of the sessions are automatically merged and submitted together under high frequency access, and I call it "auto bulk submit". The auto bulk submit is realized by controlling the task scheduling of asyncio in a little hacky way and it makes large performance improvement. And the overflow protection for the CQ is also implemented by using Semaphore.
I'm not sure because I'm just a beginner but I think these APIs may be useful for developing the io_uring applications on Python.
If you are interested in my library, could you give me some comments or advice?