On Jun 22, 2012, at 2:52 PM, Peter Westlake <peter.westlake(a)pobox.com> wrote:
> On Thu, Jun 21, 2012, at 10:16, Glyph wrote:
>>
>> Le Jun 21, 2012 à 6:52 AM, Peter Westlake <peter.westlake(a)pobox.com> a
>> écrit :
>>
>>> How fast is rendering in nevow? I have a page which is mostly a large
>>> table with a couple of hundred rows, each containing a form. The
>>> generated HTML is about 500 KB. Leaving aside the question of whether
>>> this is a good design or not, how long would you expect it to take? I'm
>>> interested specifically in what happens between the end of beforeRender
>>> and the request being completed. It takes about a minute and a quarter.
>>> Is that normal, or is there a delay in my code that I haven't found yet?
>>>
>>> Thanks,
>>>
>>> Peter.
>>
>> What does your profiler tell you?
>
> There's a profiler? There's a profiler! There it is,
> right up there at the top of the man page! Thank you!
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?
> Peter.
>
> P.S. sorry, this was really meant to go to the twisted-web list.
> I suspect a last-minute substitution by my email client.
Thanks for the thought, at least. Cross-posted.
-glyph
Hi!
I'm thinking about using Twisted as a http client, talking to some
rather uncooperative servers that sit on the other side of some really
crappy parts of the internet. So I need timeouts.
I was looking into t.w.c.Agent, and see that it has a connect timeout
option, which is good, but lacks request timeouts. Then found
http://twistedmatrix.com/trac/ticket/4330 which looks like a solution.
I'm a little confused on how to use #4330. Would something like this be
appropriate:
def main():
agent = Agent(reactor)
deferred = agent.request('HEAD', url)
cancel = reactor.callLater(30, deferred.cancel)
deferred.addCallback(handle_request)
deferred.addErrback(handle_errors)
def handle_request(response):
cancel.cancel()
<handle response>
def handle_errors(failure):
<see if failure is CanceledError>
Will this also automatically give me a connection timeout, or should I
give Agent's constructor connectTimeout as argument and handle that in
handle_errors too?
I might have totally misunderstood the whole thing too, as I'm a bit new
to Twisted.
Thanks,
\EF
I want to implement a protocol for FCGI twisted.web. Search did not
help me. It may already have an implementation? If nothing like this,
i will continue its implementation.