Jinja2 and Mako are both apparently pretty fast.
How do these compare to (the less featured but probably good enough for what I\'m doing) string.Template ?
From the jinja2 docs, it seems that string.Template is the fastest if that's all you need.
Without a doubt you should try to remove as much logic from templates as possible. But templates without any logic mean that you have to do all the processing in the code which is boring and stupid. A template engine that does that is shipped with Python and called string.Template. Comes without loops and if conditions and is by far the fastest template engine you can get for Python.