The web application project that I am currently working on (the one for which I’ve written TGFusionCharts) has some pages with huge tables, generated using the Kid Template Language. Page loading times became more and more notable as the table sizes went up. On some pages, the rendering time could be as long as 2 seconds.
After doing that I was able to gain another performance improvement by converting my data to JSON using python-cjson, which is a fast JSON encoder/decoder module implemented in C.
I’ve collected some measurements, which are of course very specific to my application, and should be treated as such.
Each run consisted of generating the page (i.e. calling an exposed function) ten times. The data structure was preloaded to a global variable before the run, so this time is not included. However, some code that is executed by TurboGears’ expose decoration is included in the measurement.
As you can see, using this technique the page generation times is now about 5 times faster.