performance of web.py templates

78 views
Skip to first unread message

Anand Chitipothu

unread,
Mar 11, 2010, 1:26:14 AM3/11/10
to webpy
I did some optimizations to template.py and it is now running 3-5
times faster than 0.33.

I did a quick performance comparison of various templating engines
using Genshi benchmarks[1].

* basic.py

Genshi: 3.39 ms
Genshi_text: 1.27 ms
Django: 2.67 ms
Mako: 0.46 ms
Jinja2: 0.63 ms
Webpy 0.33: 1.60 ms
web.py latest: 0.52 ms

* bigtable.py

Genshi template 535.98 ms
Genshi text template 311.99 ms
Mako Template 84.14 ms
Djange template 650.58 ms
jinja2 template 135.83 ms
web.py 0.33 358.65 ms
web.py latest 68.27 ms

The first benchmark shows 300% improvement from 0.33 to latest and
web.py stands second among others.
The second benchmark shows 525% improvement from 0.33 to latest and
web.py stands first, outperforming Mako, Jinja2 and others.

[1]: http://github.com/anandology/notebook/2010/03/genshi-bench

Anand

Aydın ŞEN

unread,
Mar 11, 2010, 4:40:58 AM3/11/10
to we...@googlegroups.com
2010/3/11 Anand Chitipothu <anand...@gmail.com>

I did some optimizations to template.py and it is now running 3-5
times faster than 0.33.


Thank you Anand,

optimizations look perfect, time to try and feedback.

http://github.com/anandology/notebook/tree/master/2010/03/genshi-bench/

--
Aydın ŞEN

         Ege Üniversitesi
Uluslararası Bilgisayar Enstitüsü

Justin Davis

unread,
Mar 11, 2010, 11:06:47 AM3/11/10
to web.py
Not a huge deal, but it looks like the "webpy_tmpl" doesn't write out
the "<tr>" and "</tr>" tags.

On Mar 11, 4:40 am, Aydın ŞEN <adigeay...@gmail.com> wrote:
> 2010/3/11 Anand Chitipothu <anandol...@gmail.com>

kevin

unread,
Mar 11, 2010, 3:13:22 PM3/11/10
to we...@googlegroups.com
can you tell if jinja2 was with speedups enabled ?


--
You received this message because you are subscribed to the Google Groups "web.py" group.
To post to this group, send email to we...@googlegroups.com.
To unsubscribe from this group, send email to webpy+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webpy?hl=en.


Reply all
Reply to author
Forward
0 new messages