Opened 10 years ago

Closed 10 years ago

#22958 closed Cleanup/optimization (duplicate)

Big slowdown in runserver when pyinotify is installed

Reported by: Claude Paroz Owned by: nobody
Component: Core (Management commands) Version: 1.7-rc-1
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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)
15f82c701161b327cef54b469c00b6cbe01534db

Then further commits worsen the situation, notably (as many more files were monitored):
Fixed #9523 -- Restart runserver after compiling apps translations (#9523
2397daab4a1b95a055514b009818730f4dfc4799

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".

Change History (1)

comment:1 by Tim Graham, 10 years ago

Resolution: duplicate
Status: newclosed

Thanks for the report. Since the original fix hasn't been released, I've reopened the original ticket to keep the discussion in one place.

Note: See TracTickets for help on using tickets.
Back to Top