|
|
| Rewriting CherryPy for Speed |

|
2006-03-11 14:59:49 |
I have spent one day writing my own version of CherryPy. I
really love
CherryPy, but I want maximum control and performance. I have
reused a
lot of CherryPy's code (your WSGI server is _fantastic_)
and I have
thrown a lot of things away (I have only used those things
that I had
used in my previous CherryPy projects).
Anyway, I have tried this out on my Skeletonz system (which
is a
complex CMS system). My benchmarks are done on an iBook
(which is
_slow_). This is of a production site where there are 5
JavaScript and
CSS files + some pictures - - everything is served by the
internal
application servers. This would be a lot faster if static
content was
served by Apache.
As you seen below I gained around 4x performance gain in
speed (which
IMO is a lot).
The speed of a HelloWorld on my Powermac G5 is around 800
request pr.
sec. (which is fantastic).
Anyway, my changes are made for my own use, but I would
really love if
CherryPy got more loosely coupled - i.e. if it was easier to
customize
CherryPy. I would really love if more of CherryPy was done
like your
WSGI server.
Kind regards
Amir
http://amix.dk/
CherryPy 2.1
================================
Server Software: CherryPy/2.1.0-rc2
Server Hostname: localhost
Server Port: 14003
Document Path: /
Document Length: 3679 bytes
Concurrency Level: 10
Time taken for tests: 10.063 seconds
Complete requests: 300
Failed requests: 0
Broken pipe errors: 0
Total transferred: 1172400 bytes
HTML transferred: 1103700 bytes
Requests per second: 29.81 [#/sec] (mean)
Time per request: 335.43 [ms] (mean)
Time per request: 33.54 [ms] (mean, across all
concurrent
requests)
Transfer rate: 116.51 [Kbytes/sec] received
amiWeb testing:
================================
Benchmarking localhost (be patient)
Completed 100 requests
Completed 200 requests
Finished 300 requests
Server Software: CherryPy/2.2.0rc1
Server Hostname: localhost
Server Port: 14003
Document Path: /
Document Length: 3679 bytes
Concurrency Level: 10
Time taken for tests: 2.419 seconds
Complete requests: 300
Failed requests: 0
Broken pipe errors: 0
Total transferred: 1178415 bytes
HTML transferred: 1107379 bytes
Requests per second: 124.02 [#/sec] (mean)
Time per request: 80.63 [ms] (mean)
Time per request: 8.06 [ms] (mean, across all
concurrent
requests)
Transfer rate: 487.15 [Kbytes/sec] received
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users googlegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribe googlegroups.com
For more options, visit this group at http://
groups.google.com/group/cherrypy-users
-~----------~----~----~----~------~----~------~--~---
|
|
| Rewriting CherryPy for Speed |

|
2006-03-11 16:00:31 |
>>I have spent one day writing my own version of
CherryPy. I really love
Is it possible to release your code?
>>thrown a lot of things away (I have only used those
things that I had
>>used in my previous CherryPy projects).
What pieces did you throw away?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users googlegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribe googlegroups.com
For more options, visit this group at http://
groups.google.com/group/cherrypy-users
-~----------~----~----~----~------~----~------~--~---
|
|
| Rewriting CherryPy for Speed |

|
2006-03-11 17:02:29 |
If I am reading your results correctly it looks like your
code is based
on 2.2.0rc1 while you benchamarked against 2.1.0 rc2.
(unless that is a
typo)
Could this have any affect on the relative speed as well?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users googlegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribe googlegroups.com
For more options, visit this group at http://
groups.google.com/group/cherrypy-users
-~----------~----~----~----~------~----~------~--~---
|
|
| Rewriting CherryPy for Speed |

|
2006-03-11 17:11:39 |
thakadu:
Nop. 2.2 is actually slower than 2.1.
A while back I did some benchmarks:
http://groups.go
ogle.dk/group/cherrypy-devel/browse_thread/thread/4d549b755f
d0b9c5/98a2855498efffef?q=Perfomance+of+CherryPy+2.2&rnu
m=1#98a2855498efffef
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users googlegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribe googlegroups.com
For more options, visit this group at http://
groups.google.com/group/cherrypy-users
-~----------~----~----~----~------~----~------~--~---
|
|
| Rewriting CherryPy for Speed |

|
2006-03-11 17:09:20 |
>> Is it possible to release your code?
I think my code is pretty useless, unless you use CherryPy
exactly as I
do. My code isn't compatible with CherryPy and I would not
recommend
using it. It's just a dirty hack to test and learn things.
http://amix.dk/uploa
d/amiWeb.zip
There is a test file called run.py
>> What pieces did you throw away?
A better question would be what I left in:
- Support for CherryPy's url to object mapping. No support
for default
methods or positional parameters (they are cool, but I
don't use them)
- CherryPy's WSGI server
- Support for sessions using Myghtys sessions (which is a
pretty neat
session library)
- Support for redirect (by rasing a HTTPRedirect - as in
CherryPy)
- Support for handling of static files
- Basic support for filters
- Basic config support
I.e. a very little subset of CherryPy's features.
Kind regards
Amir
http://amix.dk/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users googlegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribe googlegroups.com
For more options, visit this group at http://
groups.google.com/group/cherrypy-users
-~----------~----~----~----~------~----~------~--~---
|
|
| Rewriting CherryPy for Speed |

|
2006-03-11 18:10:52 |
I am sure you can anticipate my next question
Did you use the "cherrypy.lowercase_api = True"
line in your tests?
(I suspect the answer is "yes')
Aside from that, do you have any idea what the difference in
performance is if you leave out filters? I thought I saw
somewhere some
discussion about the possible removal of filters from
cherrypy 3.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users googlegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribe googlegroups.com
For more options, visit this group at http://
groups.google.com/group/cherrypy-users
-~----------~----~----~----~------~----~------~--~---
|
|
| Rewriting CherryPy for Speed |

|
2006-03-11 18:38:58 |
> Did you use the "cherrypy.lowercase_api =
True" line in your tests?
(I suspect the answer is "yes')
I did some testing with lowercase_api turned on and off.
When
lowercase_api is True, then the performance is "the
same" for 2.1 and
2.2. With lowercase_api turned off the performance is around
50%
slower.
> Aside from that, do you have any idea what the
difference in performance is if you leave out filters?
I don't know how big the gain would be, but filters aren't
designed in
a smart way right now.
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. Anyway, there
is also a
check-up to see if the filter is turned on... Etc.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users googlegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribe googlegroups.com
For more options, visit this group at http://
groups.google.com/group/cherrypy-users
-~----------~----~----~----~------~----~------~--~---
|
|
| Rewriting CherryPy for Speed |

|
2006-03-11 20:50:47 |
My needs are very similar. I'd go further and drop static
file handling
from cherrypy and remove filters as well (if there is a big
performance
impact)S. One thing that would be needed is the file upload
capability.
Some of my pages need that functionality.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users googlegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribe googlegroups.com
For more options, visit this group at http://
groups.google.com/group/cherrypy-users
-~----------~----~----~----~------~----~------~--~---
|
|