2010-04-30
It is rather sketchy still, but I’ve just put up a little idea about a way to avoid doing template languages at all, and
embedding HTML into Python code directly instead.
It is called NonTemplate. Let me know what you think!
UPDATE: Some vague performance figures, using the same very simple benchmark as the previous template language performance comparison posts.
These figures are running on Python 2.6.5, on a linux laptop (x64) with output to /dev/null …
print: 1.612
Mako: 1.756
Jinja: 10.803
nontemplate: 18.198
django: 42.212
SimpleTAL: 59.024
genshi: 81.460
… mako is very very clearly the winner here … its code generation is head-and-shoulders above the rest, producing pretty much
exactly the same code as you’d get if you wrote a whole lot of “print” statements yourself. Nontemplate is stuck in the middle … unfortunately, all the ‘with’ shenanigans turns out to be pretty slow. On the other hand, it is still a lot quicker than Django templates, SimpleTAL or Genshi, and a lot smaller than any of them, so I guess it is not all bad news.
2 Comments |
Templating Languages, python |
Permalink
Posted by nickzoic
2009-08-11
So I’m playing around with Google AppEngine (still!) trying to put together some kind of sensible use for it. AppEngine is neat-O, but it is also quite limited in what it can and can’t do. One of the most glaring problems (for my toy app) is the datastore query API, which has various restrictions, including:
Inequality Filters Are Allowed On One Property Only
Now this is pretty obviously an efficiency measure: retrieving on inequalities involves iterating along one index, and the datastore isn’t in the business of picking which one to iterate along. But its also really annoying if you actually want to do something which needs multiple inequalities.
Read the rest of this entry »
2 Comments |
AppEngine, Web Programming, python |
Permalink
Posted by nickzoic
2009-06-03
I’m still wrestling with crazy Template languages, as I have been for pretty much the whole time I’ve been working with Perl for Internet Stuff. In this article, I’m comparing four compiled Perl template engines: Template Toolkit 2, HTML::Template, Text::Template::Simple and Petal.
Read the rest of this entry »
Leave a Comment » |
Templating Languages, perl |
Permalink
Posted by nickzoic