I know this is a little funny question, but I didn't have the chance to realize what makes any difference when programming x64 or x86 at high level languages (.NET for instance).
Any explanations would be appreciated.
|show 5 more comments|
The only real difference you'd notice when using a HLL is going to be code size, and discovering that some features/libraries aren't available for x64 yet. Oh, and x64 code tends to be less performant, at least under .NET. The app I'm working on runs about 20% faster when I compile for x86. I don't know if it's because I use more bus bandwidth moving 8-byte quantities around, or if there's some "chunking" going on to adapt 32-bit APIs to 64-bit.
At the level you are talking about (.NET) there is very little difference. When you are using completely managed code the JIT will automatically compile your code and it will work pretty much the same, with different performance characteristics. For some things it will be faster (processing a lot of data, data could be processed in 64 bit chunks, more registers available etc), and for others slower (64 bit data (ie pointers) is slower to load into the cache for starters, meaning more data and slower transfers from main memory).
You only really have to worry about the difference when you use unmanaged code. This blog has a good run down of the issues.
There are actually three processors:
With the proper hardware and compatible software, 64-Bit wins every time. So, .Net Programs that will be written for 64bit systems will have larger address space, and so will be much faster than x86-32 bit based programs. But their market share is not much. 64bit systems are still new, and the software being used on them is either 32bit or written after tweaking compiler and optimized for 64bit systems so that it can run faster.
Edit: 64bit CPUs are new. They have been here for over 2 decades. Wikipedia confirms this. Now market has been very stable for them. Actually CPU is not everything. When a program is written in a particular environment like .NET, it can affect the performance of the program.
So, on the efficiency of a program, three things can affect: 1. CPU architecture 2. OS 32/64 3. Implementation of the Compiler (whether 32bit compiler is better written and optimized or 64bit one).
I have seen many people use 32bit windows running on 64bit systems.
|show 3 more comments|