Python 2.3.3 : Win32 build vs Cygwin build performance ?

Nicolas Lehuen thitucad6tim at jetable.org
Wed Jan 28 08:30:18 CET 2004


One of my test machine was a 2,4 Ghz P4 (without hyperthreading), the other
an Athlon XP 2500+, both with 512 Mb of RAM and running under Windows XP.

In fact if I directly launch the test\pystones.py script, I dot get
marginally better results using the Win32 build :

E:\Documents and Settings\Nico>python E:\Python23\Lib\test\pystone.py
Pystone(1.1) time for 50000 passes = 1.36434
This machine benchmarks at 36647.7 pystones/second

$ python /lib/python2.3/test/pystone.py
Pystone(1.1) time for 50000 passes = 1.492
This machine benchmarks at 33512.1 pystones/second

So there must be something weird in the hotshot scripts... The cygwin build
being slightly slower than the pure Win32 build is something that feels much
more sensible.

Regards,
Nicolas

"Paul M" <pmagic at snet.net> a écrit dans le message de news:
bv74fr$1sdl$1 at netnews.upenn.edu...
> Nicolas Lehuen wrote:
>
> > I have reproduced this on another machine. I tried playing with the
> > optimizer options (-O, -OO) and the result is the same : on pystone,
Cygwin
> > 1.5.6-1 + Python 2.3.3-1 is nearly twice as better as the standard
Python
> > 2.3.3 distribution for Win32...
> >
> > I have checked that both distribution are psyco-free. Does anyone have
an
> > idea of what is going on there ? Better compilation optimisation
settings ?
> > GCC 3.3.1 producing faster code than MSVC 6 (allright, I can imagine
that,
> > but twice faster ???) ?
> >
> > Regards
> > Nicolas
> >
>
> I get results opposite yours (though with an oddity in the CPU seconds
> reported on the Win32 build -- see below).
>
> I'm also using Cygwin 1.5.6-1 + 2.3.3-1 and the stock Python 2.3.3
> distribution for Win32.
>
> Here's my cygwin results:
>
> $ time python /usr/lib/python2.3/hotshot/stones.py
> Pystone(1.1) time for 50000 passes = 2.813
> This machine benchmarks at 17774.6 pystones/second
>           850004 function calls in 5.825 CPU seconds
>
>     Ordered by: internal time, call count
>
>     ncalls  tottime  percall  cumtime  percall filename:lineno(function)
>      50000    2.148    0.000    2.207    0.000 pystone.py:184(Proc6)
>      50002    1.102    0.000    1.102    0.000 pystone.py:45(__init__)
>          1    0.662    0.662    5.825    5.825 pystone.py:79(Proc0)
>      50000    0.435    0.000    4.188    0.000 pystone.py:133(Proc1)
>      50000    0.340    0.000    0.340    0.000 pystone.py:208(Proc8)
>     150000    0.182    0.000    0.182    0.000 pystone.py:203(Proc7)
>     150000    0.181    0.000    0.181    0.000 pystone.py:221(Func1)
>      50000    0.170    0.000    0.226    0.000 pystone.py:229(Func2)
>      50000    0.163    0.000    1.265    0.000 pystone.py:53(copy)
>      50000    0.152    0.000    0.214    0.000 pystone.py:160(Proc3)
>      50000    0.103    0.000    0.103    0.000 pystone.py:149(Proc2)
>      50000    0.072    0.000    0.072    0.000 pystone.py:177(Proc5)
>      50000    0.059    0.000    0.059    0.000 pystone.py:246(Func3)
>      50000    0.056    0.000    0.056    0.000 pystone.py:170(Proc4)
>          1    0.000    0.000    5.825    5.825 pystone.py:67(pystones)
>          0    0.000             0.000          profile:0(profiler)
>
>
>
> real    0m35.403s
> user    0m34.827s
> sys     0m0.233s
>
>
> And my Win 32 results:
>
> C:\Documents and Settings\pmagwene>python
c:\Python23\Lib\hotshot\stones.py
> Pystone(1.1) time for 50000 passes = 2.44903
> This machine benchmarks at 20416.3 pystones/second
>           850004 function calls in 6559.446 CPU seconds
>
>     Ordered by: internal time, call count
>
>     ncalls  tottime  percall  cumtime  percall filename:lineno(function)
>          1 1689.491 1689.491 6559.412 6559.412 pystone.py:79(Proc0)
>      50000  987.212    0.020 2610.494    0.052 pystone.py:133(Proc1)
>      50000  775.010    0.016  775.010    0.016 pystone.py:208(Proc8)
>      50000  416.668    0.008  637.938    0.013 pystone.py:53(copy)
>     150000  409.522    0.003  409.522    0.003 pystone.py:221(Func1)
>      50000  406.804    0.008  535.380    0.011 pystone.py:229(Func2)
>     150000  396.484    0.003  396.484    0.003 pystone.py:203(Proc7)
>      50000  310.752    0.006  445.215    0.009 pystone.py:160(Proc3)
>      50000  290.596    0.006  410.274    0.008 pystone.py:184(Proc6)
>      50000  239.539    0.005  239.539    0.005 pystone.py:149(Proc2)
>      50002  221.310    0.004  221.310    0.004 pystone.py:45(__init__)
>      50000  150.247    0.003  150.247    0.003 pystone.py:170(Proc4)
>      50000  146.099    0.003  146.099    0.003 pystone.py:177(Proc5)
>      50000  119.678    0.002  119.678    0.002 pystone.py:246(Func3)
>          1    0.033    0.033 6559.446 6559.446 pystone.py:67(pystones)
>          0    0.000             0.000          profile:0(profiler)
>
>
>
> The Pystone time and machine benchmark shows that my Win32 build is
> faster, though I don't understand the CPU seconds readout -- the pystone
> benchmark did not last 1.5 hrs!
>
> Maybe it's something odd about my setup? -- dual Xeons (hyperthreading
> enabled), 2.5 GB ram, WinXP...
>
> --Paul





More information about the Python-list mailing list