Rob wrote:

I don't want to start a 64bit vs 32 bit war, or a Windows versus *nix
war, but it has been my experience so far that the fastest benchmarks
for a highly computation intensive program written in Numeric Python
came on my 3.5Ghz P4 laptop with hyperthreading- on Windows.  Also,
running the same program on an AMD Opteron gave me a slower speed no
matter what OS I was using.

Did you recompile or install a 64-bit version of python for the Opteron? If not, you are comparing a 32-bit processor doing 64-bit computations using 32-bit instructions to a 64-bit processor doing 64-bit computations using 32-bit instructions, which is probably not what you intended.

I am baffled by the behavior.  The only thing I can figure might be
occuring would be that the *nix 64 bit toolchains are much younger than
the 32 bit ones.  But as the 32 bit Numeric Python on Windows is still
3x faster than the *nix equivalents, I have asked Activestate, the
Windows Python provider, if they do anything special when compiling the
code and they say no.  I think they said that they use some ordinary MS
comiler.

Well, MS makes _very_ good compilers, from a speed standpoint. It's difficult to find an objective comparision between the Visual C++ compiler and GCC, but it would not surprise me at all if the VC++ produced code that was 10-30% faster for many cases.

For example, VC++.NET can use "whole program optimization", where much of the optimization is delayed until the linking step, when data from all comilation units (.o files) can be used to make decisions. This results in more inline functions, more unreachable code being deleted, better function ordering, and so on.

As for being 3x faster on Windows, that seems a bit strange to me. Were the "*nix" versions of python compiled specifically for the processor? Running code 'optimized' for a 386 on a modern processor would account for this difference in performance.

Note that the OS should make very little difference here. You could probably do a similar comparison using the ActiveState python on Windows vs the cygwin version of python.

-Richard

--
gentoo-user@gentoo.org mailing list

Reply via email to