Differences between revisions 1 and 2
Revision 1 as of 2006-06-23 05:40:33
Size: 694
Editor: b0790
Comment:
Revision 2 as of 2011-02-15 06:05:18
Size: 694
Editor: localhost
Comment: converted to 1.6 markup
No differences found!

The time taken to parse a template:

   albatross.Template(ctx, '<template>', text)

was compared with the time taken to unpickle a template:

   cPickle.loads(pickled_template)

cPickle.loads was about 3-6x faster. Template parsing took about 1ms per 1kB of template (3.2GHz P4). HOWEVER - apps deployed via persistent means such as FastCGI or mod_python will only load/parse a given template once, so the complexity overhead of pickled templates is not considered to be worthwhile.

Note that if this is implemented, the pickling should be done at template install time (via a "compiler"), rather than on demand in the application: the later is a security nightmare.

None: PickledTemplates (last edited 2011-02-15 06:05:18 by localhost)