List Info

Thread: Rewriting CherryPy for Speed




Rewriting CherryPy for Speed
user name
2006-03-11 20:05:21
amixamix.dk wrote:
> Subject: [cherrypy-users] Re: Rewriting CherryPy for
Speed

First off, thanks for taking the time to do all of this!
It's good to know where CP can be improved. I've been the
performance czar for CP lately, and I'll be looking over
your code to see what ideas I can steal. ;)

> In every filter function cherrypy module gets
> imported - I don't know how smart Python is
> when importing the cherrypy module, but I could
> imagine that this is a big performance loss.

Actually, re-imports are very fast, it's a single
dictionary lookup to see if that module has already been
imported. If so, no further processing takes place.

> Anyway, there is also a check-up to see if the filter
> is turned on... Etc.

Yes. One thing that should definitely happen is to do that
basic "on" test inside the filter manager,
instead of inside each filter (which takes a method lookup
and function call for each one, even if they fail). Function
calls are almost always the primary speed culprit (when
Python is the bottleneck, that is). Minimizing some
unnecessary function calls in future versions of CP is a
good goal.


Robert Brewer
System Architect
Amor Ministries
fumanchuamor.org


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at http://
groups.google.com/group/cherrypy-users
-~----------~----~----~----~------~----~------~--~---
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )