Open superlou opened 2 weeks ago
Wow. That sounds serious. We aim for a super fast reload. Can anyone else with Windows reproduce this?
@superlou do you test it in pure termial or in ide's integrated terminal? It soulds like similar bug in pycharm or in vscode i met.
I was testing in a pure terminal, both Powershell and CMD had similar behavior (as well as Microsoft Terminal running Powershell).
@superlou This might be a bit skewed because I'm using Windows 10 in a VM but for me with the nicegui version you specified and running your code example in cmd.exe it takes about 5 seconds on average to reload the page during file saves. Using Git Bash takes about 4 seconds on average though it has trouble handling Ctrl + C for me as well.
On Linux it's nearly instant for me so seems to be a very Windows-y problem.
Upgrading to the latest NiceGUI version doesn't seem to change anything speed-wise either so it might be related to the way filewatcher picks up on filechanges on Windows in comparison to the other OS-es?
Description
A simple application starts up in a second or two, but on making a change, reloading may take 10 seconds or more and may hang. Additionally, when hung, the terminal (both PowerShell and CMD) has no response to ctrl-c or clicking the close button. It's been about a year since I've used NiceGUI on Windows (I mostly use Linux) and I don't remember this behavior before.
It sounds a bit like https://github.com/zauberzeug/nicegui/issues/3344, but this isn't in PyCharm. There are also some issues in uvicorn like https://github.com/encode/uvicorn/issues/1972 that sound related, but I know enough about the NiceGUI stack to know if that could be the root cause.
My test script is:
Steps to recreate:
simple.py
.python simple.py
in a Windows terminal.ui.button(...)
calls and save the file.Environment:
Edit: I tried the same test in WSL2 on the same computer and reloads are very fast, under a second.