AMD Athlon 64 single core 1.8Ghz, WinXP 32bit:
w/Debugger = 5140 ms
without = 1172 ms
Most likely it's a optimization issue, multiple cpu systems only perform better with multiple threads.
Hyperthreading and similar however may benefit from pairing.
I.e. instead of reading a value from memory then using it,
it may be better to read two values, then use the two values.
Another issue is floating point handling,
switching between integer and float is more expensive than just integer or just float.
commented asm of your loop
Code: Select all
MOV dword [v_start],eax
; For n = 1 To 50000000
MOV dword [v_n],1
_For1:
MOV eax,50000000
CMP eax,dword [v_n]
JL _Next2
; x = 1/Sqr(100)
FLD dword [F1]
FSQRT
FDIVR qword [D1]
FISTP dword [v_x]
; Next
_NextContinue2:
INC dword [v_n]
JMP _For1
_Next2:
I'm no asm expert but that FISTP is slow if I recall correctly.
I' sure that doing the loop directly in asm would allow it to be made differently and much faster.
If you intend to compare single and multicore/multi cpu systems,
then simply compare the slowest cpu/core with the single cpu system.
What is the speed of the two cores/slowest core/cpu?
And which windows version do you run by the way?
PS! multi cpu/multi core do provide a benefit. The OS should be able to "spread out" the processes over the cores/cpu's so overall system perfomance should be better, two heavy programs can run at once while still performing well etc.