NonTemplate

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.


Multiple Inequalities in Google AppEngine

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 »


Templates Fugit 3

2009-07-29

I’m still messing around with template languages … I’ve added a couple of new ones and here’s the revised leader board.  I tried adding ClearSilver for Perl & Python but I couldn’t get either of those to work …  pity, its an interesting approach.  As with the previous posts this is time in seconds for  1000 tables of 100 rows by 10 columns each, not counting template compilation time.  The 200x difference in performance is what makes it interesting:
Read the rest of this entry »


Templates Fugit 2: Serpents vs. Camels

2009-06-25

Why should Perl have all the fun?  Lets do the same thing but in Python, comparing Mako, Jinja and SimpleTAL: Read the rest of this entry »


Templates Fugit: Perl Template Language Performance Comparison

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 »