Opened 8 years ago

Closed 8 years ago

#3235 closed enhancement (duplicate)

[patch] resolve_variable performance issue raising VariableDoesNotExist

Reported by: Karen Tracey <kmtracey@…> Owned by: adrian
Component: Template system Version:
Severity: normal Keywords:
Cc: kmtracey@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

This has come up a couple of times on django-users: the raising of VariableDoesNotExist in resolve_variable can potentially cause a big performance hit since it may result in the entire template context being stuffed into a string. See:

http://groups.google.com/group/django-users/browse_thread/thread/60332a3ab2a14fb2/ed01f52525c9af02#ed01f52525c9af02

and

http://groups.google.com/group/django-users/browse_thread/thread/82df8bb71571fdbf/35089038df9c1976

I'll attach a patch with (what I think is) Russ Magee's suggested fix of simply including the type of object being searched instead of a full repr of it.

Attachments (1)

__init__.py.diff (795 bytes) - added by Karen Tracey <kmtracey@…> 8 years ago.

Download all attachments as: .zip

Change History (5)

Changed 8 years ago by Karen Tracey <kmtracey@…>

comment:1 Changed 8 years ago by Karen Tracey <kmtracey@…>

  • Summary changed from resolve_variable performance issue raising VariableDoesNotExist to [patch] resolve_variable performance issue raising VariableDoesNotExist

comment:2 Changed 8 years ago by Karen Tracey <kmtracey@…>

  • Cc kmtracey@… added

comment:3 Changed 8 years ago by Simon G. <dev@…>

  • Triage Stage changed from Unreviewed to Ready for checkin

comment:4 Changed 8 years ago by Karen Tracey <kmtracey@…>

  • Resolution set to duplicate
  • Status changed from new to closed

#3441 fix addressed this problem; full message still available if it's ever requested but up-front creation cost is gone.

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