Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Speed comparisons between Chameleon and Jinja2

Has anyone here done any benchmarking of Chameleon versus Jinja2, in respect to performance? I'm more used to the Jinja syntax, since I come from Django, but as Pyramid suggests to use Chameleon, I'm thinking if it would be nice to give it a try - despite having an awkward syntax, IMO.

like image 771
diogobaeder Avatar asked Mar 16 '11 06:03

diogobaeder


2 Answers

Template engines are rarely the cause of performance problems, even if chameleon is slightly faster than Jinja2 I doubt the effort of learning a new template language etc. is worth it.

Optimization of database queries and caching will probably result in more performance than you could gain by switching the template engine and take little effort.

like image 125
DasIch Avatar answered Sep 21 '22 03:09

DasIch


I think they are pretty close, and each would probably win depending on the benchmark. I think it's better to pick a templating engine based on how much you like the syntax (I prefer pyTenjin) and how easy it is to integrate it into your own project/framework.

Jinja2 is similar to Mako in speed (~20x faster than Django): source

Chameleon is also about 20x faster than Django: source

And pyTenjin is also up there: source

like image 35
Amir Avatar answered Sep 20 '22 03:09

Amir