-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Description
the watchdog reloader calls run_step every second by default
werkzeug/src/werkzeug/_reloader.py
Line 381 in 504a8c4
| self.run_step() |
on our project with 13,000 files, this causes
os.path.isfile to take 15% of a CPU core
I ran py-spy record --pid ... --output profile.speedscope.json --format speedscope for about 8 seconds on an idle app. you can place profile.speedscope.json into https://www.speedscope.app/ and see 8 calls to run() which take about 150ms each:

increasing ReloaderLoop.interval helps a lot, but means reloads have to wait for the next iteration
Environment:
- Python version: 3.12.7
- Werkzeug version: 3.0.6
mozartilize
Metadata
Metadata
Assignees
Labels
No labels