On Jan 19, 2009, at 10:37 PM, Tycon wrote:
Benchmarks indicate it is taking as much as 20% of request handling time (not including the user action).
Curious, I've done rather extensive benchmarks and never seen the registry middleware as being such a chunk. Can you elaborate?
The question is why is it even necessary to use this "registry" facility ?
It keeps the module globals not just thread-local, but request-local. In the future, it'll be more swappable to merely thread-locals if you don't anticipate WSGI app nesting (which many don't).
Similarly, other request handling operations such as creating the request object may also be redundant, because the user may not be interested in all the attributes of the request object. So wouldn't it be better to provide those things on-demand (that is using a call interface to get things such as params, etc) instead of creating all that stuff by default even when it may not be needed ?
Sure, and its possible some other things in webob.Request might be more lazily done, though at the moment, most every attribute on it only actually does its work upon access. If you can see any specific locations in it that may be further optimized, that'd be great.
Cheers, Ben
smime.p7s
Description: S/MIME cryptographic signature
