• Welcome to Jose's Read Only Forum 2023.
 

64bit slower than 32bit !?

Started by Charles Pegge, January 21, 2010, 10:53:19 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Charles Pegge

Are 64-bit Binaries Really Slower than 32-bit Binaries?


Can this really be true or is it an urban myth? Look at those benchmarks...

http://www.osnews.com/story/5768

José Roca

 
My guess is that you won't get much difference until you start to take advantage of the increased available memory and number of registers. As PB uses register variables, a future 64-bit version of the compiler will take advantage of it.

Charles Pegge


The problem is that functions which call other functions have to protect these extra registers by stacking them before calls are made - often negating the advantage.

The calling convention is quite complex and one of the bizarre things is the loading of float parameters into the XMM registers. - fine for simd arithmetic but not a good place for the FPU since they have to be transferred back into stack memory for the FPU to gain access.

Full description here. (The Linux calling convention is similar)

http://msdn.microsoft.com/en-us/library/ms235286(VS.80).aspx

Steve Hutchesson

I have this sense of humour that the old VAX guys bashed win32 together as Microsoft did not have the knowhow at the time but like the fiasco of DOS and Win3.0/1/11 when Microsoft design a calling convention they make an unholy mess of it and embedded FASTCALL into the OS design so instead of being able to nest procedures to any depth by default as you can with STDCALL in win32, you are struck with this scruffy mess of registers first then data on the stack aligned at 16 bytes and if you want to use a recursive algo like a Quick Sort which can run to recursion depths of thousands, you pick up this mountain of overhead for little other reason that Microsoft are trying to make compiler design easy for the RISC brigade.

I suggest that it is an act of sheer stupidity to waste registers in this manner, with registers you should be able to pass up to 8 arguments as FASTCALL but equally if you want recursion or are indifferent to the normal timings of stack arguments you shoud be able to pass arguments directly on the stack without the extra register copies each iteration.

The technique will produce fast message boxes but make complex code that is speed dependent much harder to write.

Theo Gottwald

Quotea future 64-bit version of the compiler will take advantage of it.

@Jose. Do you know more then we know about it :-)?

José Roca


Theo Gottwald

I really hope on PB 64. As you said, we'll have a lot more register-variables available then.