[mod_python] mod_python error

Karol Bryd kbryd at int.gnu.org.pl
Fri Jun 29 10:16:21 EST 2001


On Thu, Jun 28, 2001 at 07:17:36PM -0000, Richard wrote:
> > From: Karol Bryd [mailto:kbryd at int.gnu.org.pl]
> > 
> > PS. I have done a few small benchmarks to compare speed of PHP 4.0.5
> > and mod_python 2.7.4 - mod_python is at least 2x faster than PHP.
> > Not bad...
> 
> Just out of curiosity, what kind of benchmarking did you do?

I know that benchmarks lie, but I couldn't resist ;-)
Here is the first one (and most complex):

def test():                                                              
    start = time()                                              
    tab = {}                                            
    fp = open("/home/kbryd/public_html/python2/data", "r")                       
    n = 0                                                                
    lines = fp.readlines()                                       
    for line in lines:                                   
	fields = split(line, '=')                
        tab[n] = [fields[0], fields[1]]  
        n+=1                     
    fp.close()   
    end = time()                                                                
    return end-start                                                    

(the file is 400KB long)

It was repeated 100 times to calculate average.

Regards.
-- 
       ------------------- Karol Bryd ------------------
   ---------------- http://int.gnu.org.pl ------------------
------There's got to be more to life than compile-and-go.------



More information about the Mod_python mailing list