[Twisted-web] [Nevow] template performance

Manlio Perillo manlio_perillo at libero.it
Fri Dec 15 06:33:55 CST 2006

Tristan Seligmann ha scritto:
> * Manlio Perillo <manlio_perillo at libero.it> [2006-12-15 11:56:55 +0100]:
>> First let me say that I really like Nevow template system.
>> Once you became expert with it, it proves to be really flexible.
>> The problem is the performance.
>> I have done a simple test with the rendering of a table 5 * 20, Nevow 
>> against Django, and Nevow is much slower.
>> The problem is that, I think, there are a lot of objects adaptation.
> Can you be more specific about this? What objects are being adapted, and
> why do you think this is the cause of slowness?

I'm not sure on what's the problem.

However if I render this template (without data):

<!DOCTYPE html
   PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

<html xmlns="http://www.w3.org/1999/xhtml"
       lang="en" xml:lang="en">
     <title>Test performance</title>
     <p>Some test</p>

I got ( 100000 * t.timeit(number=10000) / 10000) )

manlio at synapsis:~/projects/tests/nevow$ python static2.py
9.85 usec/pass

manlio at synapsis:~/projects/tests/django$ python static2.py
13.31 usec/pass

Nevow for every data object calls inevow.IContainer.child.
The problem can be here, since it is called 25 times (the number of rows 
in the table)

Regards  Manlio Perillo

More information about the Twisted-web mailing list