Python 2.3.3 : Win32 build vs Cygwin build performance ?

N

Nicolas Lehuen

Hi,

Is it me, or does anyone else get significantly better pystone results under
Cygwin versus the standard Win32 build ?

CYGWIN 1.5.6 + python 2.3.3-1 :
$ time python /usr/lib/python2.3/hotshot/stones.py
Pystone(1.1) time for 50000 passes = 2.344
This machine benchmarks at 21331.1 pystones/second
850004 function calls in 4.371 CPU seconds

Ordered by: internal time, call count

ncalls tottime percall cumtime percall filename:lineno(function)
50000 1.351 0.000 2.917 0.000 pystone.py:133(Proc1)
50000 1.132 0.000 1.202 0.000 pystone.py:53(copy)
1 0.609 0.609 4.371 4.371 pystone.py:79(Proc0)
50000 0.239 0.000 0.239 0.000 pystone.py:208(Proc8)
150000 0.184 0.000 0.184 0.000 pystone.py:203(Proc7)
150000 0.157 0.000 0.157 0.000 pystone.py:221(Func1)
50000 0.147 0.000 0.200 0.000 pystone.py:229(Func2)
50000 0.104 0.000 0.153 0.000 pystone.py:160(Proc3)
50000 0.098 0.000 0.153 0.000 pystone.py:184(Proc6)
50000 0.090 0.000 0.090 0.000 pystone.py:149(Proc2)
50002 0.070 0.000 0.070 0.000 pystone.py:45(__init__)
50000 0.068 0.000 0.068 0.000 pystone.py:177(Proc5)
50000 0.067 0.000 0.067 0.000 pystone.py:170(Proc4)
50000 0.055 0.000 0.055 0.000 pystone.py:246(Func3)
1 0.000 0.000 4.371 4.371 pystone.py:67(pystones)
0 0.000 0.000 profile:0(profiler)


real 0m26.603s
user 0m25.765s
sys 0m0.280s

Win32 :
C:\Documents and Settings\nlehuen>python c:\Python23\Lib\hotshot\stones.py
Pystone(1.1) time for 50000 passes = 4.1542
This machine benchmarks at 12036 pystones/second
850004 function calls in 14.917 CPU seconds

Ordered by: internal time, call count

ncalls tottime percall cumtime percall filename:lineno(function)
1 3.772 3.772 14.917 14.917 pystone.py:79(Proc0)
50000 2.226 0.000 6.314 0.000 pystone.py:133(Proc1)
150000 1.166 0.000 1.166 0.000 pystone.py:221(Func1)
150000 1.123 0.000 1.123 0.000 pystone.py:203(Proc7)
50000 1.075 0.000 1.075 0.000 pystone.py:208(Proc8)
50000 0.939 0.000 1.410 0.000 pystone.py:53(copy)
50000 0.903 0.000 1.279 0.000 pystone.py:229(Func2)
50000 0.795 0.000 1.157 0.000 pystone.py:160(Proc3)
50000 0.776 0.000 1.137 0.000 pystone.py:184(Proc6)
50000 0.500 0.000 0.500 0.000 pystone.py:149(Proc2)
50002 0.472 0.000 0.472 0.000 pystone.py:45(__init__)
50000 0.416 0.000 0.416 0.000 pystone.py:170(Proc4)
50000 0.394 0.000 0.394 0.000 pystone.py:177(Proc5)
50000 0.361 0.000 0.361 0.000 pystone.py:246(Func3)
1 0.000 0.000 14.917 14.917 pystone.py:67(pystones)
0 0.000 0.000 profile:0(profiler)

(total real time elapsed > 30 seconds)
 
N

Nicolas Lehuen

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
 
P

Paul M

Nicolas said:
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
 
N

Nicolas Lehuen

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top