abe6a7282d
Date: Fri, Jul 26, 2013 at 1:35 AM Subject: small performance patch for Tempita we're using Tempita for some code generation bits in Cython (simply because it's small enough to embed it), and I found that it spends quite some processing time figuring out the line/column position in the template. Initialisation time is important because templates are often just executed once or a couple of times in Cython. Here's a little patch that speeds that part up. The main problem is string.splitlines(), which adds a substantial overhead for just counting lines. The patch doesn't care about the line ending format of the file, not sure if that's a problem. You might want to use regexes if it is. Also, I didn't really find any tests for this code, so I've probably broken it with an off-by-one or something. It seems to give the same error positions as before, though. Stefan |
||
---|---|---|
docs | ||
tempita | ||
tests | ||
.hgignore | ||
.travis.yml | ||
MANIFEST.in | ||
README.md | ||
regen-docs | ||
requirements.txt | ||
setup.cfg | ||
setup.py | ||
tox.ini |
README.md
Tempita
A small templating language for text substitution, originally authored by Ian Bicking.
It isn't intended to be the Next Big Thing in templating, just a handy little templating language for when a project outgrows string.Template or {} substitution.
It's small, it embeds Python in strings, and it doesn't do much else.
You can read about the language, the interface and that's it, there's nothing more to learn about it.
You can install the original 0.5 from the bitbucket repository with:
easy_install Tempita==dev
Note from gjhiggins
I transmigrated this to GitHub in order to take advantage of travis-ci continuous integration and took the opportunity to give the py3 compat and tests a buffing (March 2013).