Vizonex/Winloop

Exposing asynciomodule.c's internal CPython Objects to Cython to improve performance.

Aperta

#57 aperta il 20 lug 2025

 (0 commenti) (0 reazioni) (1 assegnatario)Cython (24 fork)auto 404
deviates-from-uvloopenhancementhelp wantedinternal-refactoringquestion

Metriche repository

Star
 (228 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

For over a month now I was thinking of ways to improve our library and one Idea I had was to implement a way to expose cpython's internal _asynciomodule.c datatypes such as Task and Future so that the performance of our library will increase. The same could be done with uvloop and is not limited to us. An example of this kind of Exposure to Cython that I am referring to comes from this implementation to expose the CPython array.array type which is noted as being a "Hard-coded utility code hack." This way when libuv performs a callback from a handle that sets a future it will run as smooth as possible with minimal to zero python interactions. I am posting about it as an issue incase others wish to disagree or argue for or against this idea. Like I said this could be done to uvloop as well even though we might beat them to it and I could see a 20% performance increase if were extremely lucky.

Guida contributor