viktor-ferenczi / genshi-compiler

Genshi markup template compiler
0 stars 0 forks source link

Make the generated code even faster #8

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
We could make the generated code faster by enhancing the optimizing and code 
formatting steps based on the ideas from this great slideshow:

http://www.slideshare.net/kwatch/how-to-create-a-highspeed-template-engine-in-py
thon

If a given trick is introducing new dependencies to the generated code, then we 
should make that optional, like if we were using the `webext` extension module: 
http://pypi.python.org/pypi/Webext

We should implement the easier improvements first, then the hardest ones in 
multiple steps. There can be a point where it just would not worth the 
additional trouble to make it 1% faster...

Original issue reported on code.google.com by ferenczi.viktor on 17 Jul 2011 at 12:36

GoogleCodeExporter commented 9 years ago
Regarding r9 (0.1.2): There is also room for simply joining code lines emitting 
markup. The current optimizer does not seem to work as well as it should. Just 
take a look at the compiled source code of the `i18n` test template.

Look for markup fragments:

    _x_append_markup(u'"')
    _x_append_markup(u'>')

Original comment by ferenczi.viktor on 16 Jan 2012 at 3:09