Winloop and NiceGUI: Potential speed improvement? #4474
Replies: 4 comments 9 replies
-
Behaviour on Ctrl+C (KeyboardInterrupt)Before add A bit of delay, classic Windows. Now you know why I do ![]() After add Delay is much less, though not instant but much better already. ![]() Notably, the It seems that we are indeed using Proclaimed speed improvement from https://github.com/Vizonex/Winloop?tab=readme-ov-file#tcp-connections That's pretty decent, if you ask me. |
Beta Was this translation helpful? Give feedback.
-
Wow. Very impressive. Thanks for sharing. Is that something we could integrate into NiceGUI directly? |
Beta Was this translation helpful? Give feedback.
-
Well, no need to modify Check: https://github.com/evnchn/nicegui-winloop-easy Help is needed to test this more completely. |
Beta Was this translation helpful? Give feedback.
-
@falkoschindler If we do embark on putting winloop into NiceGUI (think: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Kicked started by #184 leading me to a rabbit hole.
Today I learnt that besides
asyncio
there aretrio & anyio
, and thatasyncio
allows to configure something called an "event loop", withuvloop
being the prominent fast one which doesn't run on Windows butwinloop
does.With that out of the way, as we all know, NiceGUI runs on Uvicorn, which officially supports 'auto', 'asyncio', 'uvloop' only, with a PR in progress at uvicorn #2435
Call me decently surprised when I tried the example in the winloop readme page, fix some changed symbols (
WinLoopPolicy -> EventLoopPolicy
), put NiceGUI with ui.run_with, and NiceGUI actually running with winloop!!!.Attached please find evidence.
And the code I used:
https://gist.github.com/evnchn/1772e80587775f9603ae91606aa7fdf1
Could be huge if the description provided by winloop devs in README is true:
Beta Was this translation helpful? Give feedback.
All reactions