Vizonex / Winloop

An Alternative library for uvloop compatability with windows
https://pypi.org/project/winloop
Apache License 2.0
74 stars 7 forks source link

Found cause for issue #18. #26

Closed lschoe closed 1 month ago

lschoe commented 1 month ago

Is calling uv.uv_disable_stdio_inheritance() needed at all?

Vizonex commented 1 month ago

@lschoe Depends. I think it should be feature if I should be honest with you. I implemented this in the hopes that there would be a performance increase.

lschoe commented 1 month ago

OK @Vizonex, let's make a (mental) note about this, also have it in the commit history, but go ahead and remove it for the time being. These potential performance improvements can be investigated later, once winloop is integrated with uvloop, I would say.

Vizonex commented 1 month ago

@lschoe I guess the only problem now might be Cython's recent deprecation of macros. Other than that I am overall very excited about these future changes.

lschoe commented 1 month ago

Hi @Vizonex . Oh, nice! Yes, indeed the use of Cython DEF should ultimately be dropped from the code. But for now I would keep it in where uvloop also still has it, and when uvloop drops it, winloop can follow suit.

The present differences between winloop and uvloop are converging steadily to the essential ones. By using things like if system.PLATFORM_IS_WINDOWS we can insert some Windows specific code at runtime. And in the C header files we can still use DEF. And similar things, as advocated in Deprecation of DEF / IF.

lschoe commented 1 month ago

Hi @Vizonex, I did another round of updates. I've added some unit tests from uvloop (the ones that do not fail). Also, now using uvlib as a git submodule. Many changes throughout, also making setup.py more like uvloop. Only left the macros that seem to be essential ("WIN32_LEAN_AND_MEAN", 1) and ("_WIN32_WINNT", "0x0602").

Would be nice if you can update the yaml files to also build a Python 3.8 version? That runs as well as 3.9, so until uvloop drops 3.8 we can let winloop support 3.8.

Vizonex commented 1 month ago

@lschoe I would make one but I do not understand how to compile workflows I've tried even just compiling a nightly build. It's just too difficult for me. However I am watching these updates closely I may even try compiling what has been done as a testrun.

lschoe commented 1 month ago

Hi @Vizonex, I saw your update to the README.md. I would be a bit more cautious with this, as I think the merge with uvloop will take quite a bit more time. They will only consider this if everything is kind of flawless. For that most of the uvloop tests should pass, on all platforms, which will still be a lot of work to accomplish. Also related to issues like #22, which involves use of pipes (I ran the program of #22 on Unix, there it works with uvloop, but on Windows it does not with winloop, but also not with the asyncio loop).

Given that, I would recommend that you release version 0.1.4 now, or soon, such that people can try it and test it. Also important to include the Python 3.8 version this time around. Then Python 3.8-12 are covered, just as uvloop does. The fix for issue #18 will also be included. And, not unimportantly, the requirement for cython should be gone (hence people need to wonder or worry about needing cython for just running winloop).