[Twisted-web] [Twisted-Python] Speed of rendering?

Peter Westlake peter.westlake at pobox.com
Tue Oct 23 11:10:31 EDT 2012

On Tue, Sep 4, 2012, at 19:30, Glyph wrote:


> >>> 
> >>> Not only is there a profiler, there's benchmarks!
> >>> 
> >>> 	<http://speed.twistedmatrix.com/timeline/>
> >>> 
> >>> Maybe you could add one for twisted.web.template rendering speed?
> > 
> > Okay, I've found out how to use the profiler (though I never did
> > find out what I did wrong the first time) and I'm reading the docs
> > about how to interpret the results. The benchmark code doesn't look
> > as though it uses the profiler, just times a number of repetitions
> > - is that right? So a benchmark for t.w.template would consist of
> > some functions that called flatten() once each?
> That's the general idea, yes.  Of course, each benchmark should try to be
> vaguely representative of some real-world use-case so that we don't
> optimize one case too much in favor of another.


I haven't forgotten about this. The problem I'm having is that
flatten() returns immediately if given a string or anything
else without an unfired Deferred, and that sends Client._continue
into an unbounded recursion. Is there a general good way to handle
this kind of problem? Somehow I need to return control to the
reactor long enough for Client._request to return.


More information about the Twisted-web mailing list