minor ForNode.render reversed optimization
|Reported by:||(removed)||Owned by:||Adrian Holovaty|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
short version, nestled snuggly in django.template.defaulttags.ForNode.render is a homebrewed native reverse implementation; aside from it using range when it should be using xrange, this is fine for <py2.4; for >=py2.4 however, the builtin reversed should be used (fair bit faster among other things).
So... attached is a patch doing just that; for folks using >=2.4, it's a linear 10x boost (mass index lookups kill kittens when in combination with native py vs cpy speeds), so... worth adding.
Change History (3)
comment:1 Changed 9 years ago by
|Patch needs improvement:||unset|
|Triage Stage:||Unreviewed → Ready for checkin|