[PATCH] RFC: Monkey-patch Django performance bug

Stephen Finucane stephen at that.guru
Fri Sep 8 04:41:36 AEST 2017


On Sun, 2017-09-03 at 23:36 +1000, Daniel Axtens wrote:
> OzLabs noticed a performance regression, which was traced to the
> loading of the 'headers', 'content' and 'diff' fields, despite
> the 'defer()' call in views/__init__.py:generic_list()
> 
> This is a django bug, reported upstream and fixed at:
> https://code.djangoproject.com/ticket/28549#ticket
> https://github.com/django/django/pull/8994
> 
> I will be preparing a patch for the Debian-based system OzLabs uses,
> but I am wondering if we need a more generic approach for all our
> potential users, rather than asking people to patch their systems.
> This is one way to do it:
> 
> Monkey-patch the broken method, and add a test to verify correct
> behaviour.
> 
> It's also a somewhat terrifying approach, so ther suggestions are
> very welcome.
> 
> Signed-off-by: Daniel Axtens <dja at axtens.net>

OK, so I know this is a pretty serious performance issue but I really don't
want to merge this :( It's far too...hacky, as you say above, and pretty
unmaintainable to book.

What version of Django is the Ozlabs instance using? Would it be possible to
work with the upstream Django folks to get this backported to those versions?
If nothing else, this patch is there and I'd be OK to add a pointer in the docs
about it. I just don't want to merge it in Patchwork, heh.

Stephen


More information about the Patchwork mailing list