jj2007: improvement of 64-bit code over 32-bit code is, ehm, negative.
- That's a remarkably polite way to put it!
My experience comparing the two was pretty extensive (for a newbie). Speed-wise, the difference was minor in cases I dealt with (a small subset of all cases that exist, of course). For normal programming 32-bit was a little faster, I think due to the reduced code size (better for cache of course). But I'm particularly interested in "complicated" CPU-intensive algos which benefit from those extra registers. In those cases I got a few percent improvement from 64-bit. Undoubtedly one could find an algo which really needs extra registers, which would improve significantly more, but it would be a rare case; I know of none. However the enhanced ease of programming is a big plus.
I also worked on algos which benefit from the register's extra width - primarily large primes (which I never posted, there seemed no interest). At the 10^18 range I was getting significant improvement, 20% or so. However there's a counterexample. Chris Wallich, using C++ and working in this area far more than I, said the improvement was only a few percent. I don't know why. Anyway I think that (as with the extra registers) the right algo will benefit significantly from that extra width.
Finally if you're using the large address space a lot, surely 64-bit is going to be faster; I have almost no experience with that.
Apart from such specialized work I concluded 32-bit was a little faster. However in another post you reported (iirc) a much greater speed hit from 64. I would tentatively guess that's an artifact and if you put more work into it you'd get 64-bit to perform almost as well as 32-bit. Of course the obvious question is, why should you bother?
About code size: if you don't use LARGEADDRESSAWARE 64-bit is only 10 or 20 percent larger. There are negatives; qWord doesn't like it; but it works fine on my personal machines. I think it might contribute, however, to porting difficulties.
Overall 64-bit is something of a disaster, I'm afraid; but it's MicroSoft's fault not Intel's. 64-bit, in my limited experience, is far less compatible because (IMHO) Microsoft dropped the ball with their poor ABI and poor support for us poor assembler programmers! But for C++ (and, I suppose, other HLL's) it seems 64-bit is "a good thing" (as Martha Stewart used to say) - because MS supports it thoroughly, while effectively deprecating 32-bit.