1 |
Rob wrote: |
2 |
|
3 |
>I don't want to start a 64bit vs 32 bit war, or a Windows versus *nix |
4 |
>war, but it has been my experience so far that the fastest benchmarks |
5 |
>for a highly computation intensive program written in Numeric Python |
6 |
>came on my 3.5Ghz P4 laptop with hyperthreading- on Windows. Also, |
7 |
>running the same program on an AMD Opteron gave me a slower speed no |
8 |
>matter what OS I was using. |
9 |
> |
10 |
|
11 |
Did you recompile or install a 64-bit version of python for the |
12 |
Opteron? If not, you are comparing a 32-bit processor doing 64-bit |
13 |
computations using 32-bit instructions to a 64-bit processor doing |
14 |
64-bit computations using 32-bit instructions, which is probably not |
15 |
what you intended. |
16 |
|
17 |
>I am baffled by the behavior. The only thing I can figure might be |
18 |
>occuring would be that the *nix 64 bit toolchains are much younger than |
19 |
>the 32 bit ones. But as the 32 bit Numeric Python on Windows is still |
20 |
>3x faster than the *nix equivalents, I have asked Activestate, the |
21 |
>Windows Python provider, if they do anything special when compiling the |
22 |
>code and they say no. I think they said that they use some ordinary MS |
23 |
>comiler. |
24 |
> |
25 |
> |
26 |
|
27 |
Well, MS makes _very_ good compilers, from a speed standpoint. It's |
28 |
difficult to find an objective comparision between the Visual C++ |
29 |
compiler and GCC, but it would not surprise me at all if the VC++ |
30 |
produced code that was 10-30% faster for many cases. |
31 |
|
32 |
For example, VC++.NET can use "whole program optimization", where much |
33 |
of the optimization is delayed until the linking step, when data from |
34 |
all comilation units (.o files) can be used to make decisions. This |
35 |
results in more inline functions, more unreachable code being deleted, |
36 |
better function ordering, and so on. |
37 |
|
38 |
As for being 3x faster on Windows, that seems a bit strange to me. Were |
39 |
the "*nix" versions of python compiled specifically for the processor? |
40 |
Running code 'optimized' for a 386 on a modern processor would account |
41 |
for this difference in performance. |
42 |
|
43 |
Note that the OS should make very little difference here. You could |
44 |
probably do a similar comparison using the ActiveState python on Windows |
45 |
vs the cygwin version of python. |
46 |
|
47 |
-Richard |
48 |
|
49 |
-- |
50 |
gentoo-user@g.o mailing list |