Sylvain Hellegouarch wrote:
> I can appreciate CherryPy being far behind lightttpd
but I
> wonder why so far away and what could be the main
bottleneck.
You know, none of you have to wonder. ;) I wrote a lovely
profiler
module and integrated it into the test suite (test.py
--profile) so that
tracking down such bottlenecks would be a couple of minutes'
worth of
work. Here's the significant entries from my box
(cp_0003.prof):
Tue Feb 07 11:32:51 2006
c:python24libsite-packagescherrypylibprofilecp_0003.p
rof
439 function calls (435 primitive calls) in 0.007
CPU seconds
Ordered by: cumulative time
ncalls tottime percall cumtime percall
filename:lineno(function)
1 0.000 0.000 0.007 0.007
profile:0(<bound method
Request._run of <cherrypy._cphttptools.Request object at
0x00BCA670>>)
1 0.000 0.000 0.007 0.007
_cphttptools.py:76(_run)
4 0.000 0.000 0.005 0.001
filters__init__.py:97(applyFilters)
8/4 0.001 0.000 0.002 0.001
_cputil.py:57(get_special_attribute)
7 0.001 0.000 0.002 0.000
config.py:101(get)
8 0.001 0.000 0.001 0.000
_cputil.py:11(get_object_trail)
12 0.001 0.000 0.001 0.000
_cputil.py:309(lower_to_camel)
1 0.000 0.000 0.001 0.001
_cphttptools.py:124(processRequestLine)
1 0.000 0.000 0.001 0.001
_cphttptools.py:164(processHeaders)
1 0.000 0.000 0.001 0.001
cachefilter.py:111(before_main)
19 0.000 0.000 0.001 0.000
cherrypy__init__.py:41(__getattr__)
That was down to .005 the last time I looked. The
lower_to_camel call
has already been dealt with, so that just leaves filters or
"something
else". In my limited experience with ab+cp, that
"something else" is
usually either 1) using Python 2.3 (which is significantly
slower than
Python 2.4 because its threadlocals are written in Python
instead of C),
or 2) you haven't turned off sys.stdout; if your test logs
to stdout,
that will take a significant amount of processing time. Turn
off
log_to_screen.
Robert Brewer
System Architect
Amor Ministries
fumanchu amor.org
|