logo       

Re: Webware & Cheetah vs. PHP - performance comparision!: msg#00014

python.cheetah

Subject: Re: Webware & Cheetah vs. PHP - performance comparision!

> My testing code is
> =============
> import os, time
> url = [
> r'http://localhost/WK/test/test1/testpython.py',
> ]
> for u in url:
> t1=time.time()
> print '>>>%s' % u,
> os.system('wget -m %s -o stress.log' % u)
> t = time.time()-t1
> print ' => time: %f s' % t

I dont understand how this is a relevant test of Cheetah/Python's
performance. You aren't really testing page serves, you're testing the
connection time, and download time (two separate performance metrics on
their own), a trivial loop, and a page load.

Typically in doing performance tests for web pages you would do something
like print out a Hello World page. Then print out a page with some dynamic
text on it generated by loops (of content on the page). Then maybe a much
more logic intensive test (still trying to avoid routines that just call
into C libraries, or arbitrarily expensive calculations that are not
real-world. You shouldnt go out to a file, a database or a disk if you are
comparing web template systems to each other. Each of these should be run
100+ times and compared.

Python may still lose in this battle, especially if the results arent
cached, and this would be seen over many loads of a page, not just one.
Different systems have different performances for the first run, vs. later
runs, depending on what needs to be initialized.

I'm not sure what algorithm MMCache is using, but more than likely the same
one could be applied to a Python web serving system. The difference may be
that it hasnt been done yet, or that it is undesirable to do because of what
people are trying to do with their PHP over Python pages (though the second
seems unlikely).

-Geoff



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise