Hi everbody,

thanks for your input. I changed the test function according to Chucks
suggestion and the results are:

duration of <function testcgi at 0x401986f4> is 532.231880903
duration of <function testwebware at 0x40591df4> is 127.881435156
duration of <function testwebwarewkcgi at 0x40591e2c> is 1289.3273561


I have also made some test with ab:

ab -n 500 http://localhost/cgi-bin/perftestcgi.py
Requests per second:    19.33 [#/sec] (mean)

ab -n 500 http://localhost/cgi-bin/WebKit.cgi/perftest
Requests per second:    7.54 [#/sec] (mean)

ab -n 500 http://localhost/WK/perftest
Requests per second:    48.12 [#/sec] (mean)


Now this seems to be realistic. Seems that my test funktion was not
accurate.

Webware (with mod_webware) is the winner, although not dramatically.
But the speed gain with webware under real conditions can only be better
than those unrealistic test scripts.

Interesting that WebKit.cgi is much slower than plain cgi.


Thanks a lot!

The new used test script:


#!/usr/bin/python

import urllib as u
import profile
#import psycopg
import os
import time

def durationOf(run, iterations=1000):  # notice bigger range
    r = range(iterations)
    start = time.time()
    for i in r:
        # multiple calls to reduce overhead from "for"
        run()
        run()
        run()
        run()
        run()
        run()
        run()
        run()
        run()
        run()
    duration = time.time() - start
    print 'duration of %s is %s' % (run, duration)
    return duration

def testcgi():
    u.urlopen("http://localhost/cgi-bin/perftestcgi.py";)

def testwebware():
    u.urlopen("http://localhost/WK/perftest.py";)

def testwebwarewkcgi():
    u.urlopen("http://localhost/cgi-bin/WebKit.cgi/perftest";)

def testpsycopg():
    for i in range(100):
        c = psycopg.connect("dbname=timcos_0")
        os.popen2("python")
        c.close()

#profile.run("testwebware()")
#durationOf(testcgi)
durationOf(testwebwarewkcgi)


Sorry for sending some private emails, I meant to send to the list.
--
Greg




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Webware-discuss mailing list
Webware-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to