Skip to content

Render takes increasingly long on large number of variables #490

Open

Description

@gnadlr

I have a template with around 12.000 variables (text only) and rendering takes a whooping 27 minutes. Is there any way to speed up rendering? Thank you.

Activity

  1. elapouya commented on Apr 27, 2023

    @elapouya
    Owner

    Did you try PyPy interpreter ?

  2. cvas22 commented on Nov 25, 2026

    @cvas22

    @gnadlr in docform, the maintained fork of python-docx-template, the last step of render was quadratic in lxml, and fixing it makes rendering linear: 12,000 variables take about 2 seconds in my tests (cvas22/docform#210). I could not reproduce 27 minutes with generated templates, so your template may have something else going on as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions