On Tue, Jan 20, 2009 at 1:37 PM, Ian Bicking <[email protected]> wrote:
> On Tue, Jan 20, 2009 at 11:36 AM, Ben Bangert <[email protected]> wrote: > >> 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. >> > > If anyone does put together something to target webob performance > specifically, that'd make the webob optimization happen a lot faster ;) > Instantiation *shouldn't* be slow (I can't say for sure if that's true, but > if it's not I'll want to fix that). And probably there's some features in > Request that should actually be taken out (like environ_getter), that might > be causing some overhead. But I'd rather work from empirical data, and I > haven't gotten around to putting that together. > Chris McDonough also noticed some speed issues with WebOb, so I put together a simple profiler: http://svn.pythonpaste.org/Paste/WebOb/trunk/tests/performance_test.py Based on this I've made a number of improvements to Response.__init__ and Request.__init__ to improve the base performance. This doesn't affect anything after initialization, but for a lot of cases these may be the only functions to be hit. (Well, setting values in Response.headers might be slightly faster) -- Ian Bicking | http://blog.ianbicking.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---
