#36242: NodeList render overhead with huge templates -------------------------------------+------------------------------------- Reporter: Michal Čihař | Type: | Cleanup/optimization Status: new | Component: | Uncategorized Version: 5.1 | Severity: Normal Keywords: | Triage Stage: | Unreviewed Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+------------------------------------- While debugging rendering of some huge templates, I've noticed that the rendering is slower and needs more memory than necessary because of:
{{{ def render(self, context): return SafeString("".join([node.render_annotated(context) for node in self])) }}} which unnecessarily builds a list and then passes it to join, which could directly consume an iterable. I will prepare a pull request with a fix. -- Ticket URL: <https://code.djangoproject.com/ticket/36242> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/django-updates/01070195805843d8-2f5f66b5-bc01-4376-afaf-4322ebac511d-000000%40eu-central-1.amazonses.com.