Big slowdown in runserver when pyinotify is installed
|Reported by:||claudep||Owned by:||nobody|
|Component:||Core (Management commands)||Version:||1.7-rc-1|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
When I'm comparing the time needed to display a basic request (such as the admin index page) when running runserver with Django 1.6 and Django 1.7, I'm seeing an 8x slowdown with Django 1.7 (from ~380ms to ~3.1sec). I also noticed that uninstalling pyinotify was restoring performances back.
When the pyinotify patch was introduced, it was slowing down request time by a factor of 2. Wasn't it supposed to improve efficiency?
Fixed #9722 - used pyinotify as change detection system when available (#9722)
Then further commits worsen the situation, notably (as many more files were monitored):
Fixed #9523 -- Restart runserver after compiling apps translations (#9523
The fact that the file list is recalculated and "re-watched" entirely after each request (even for static files!) is obviously unefficient. We should either find a way to make pyinotify more efficient that plain code_changed() or simply drop that "improvement".