32 bit vs 64 bit

When to use 64-bit?

If your application needs more than 2-4gb of data

When to use 32-bit?

After reading so many great things about 32 bit, why would anybody still want to code against 32-bit? Simple reason - code compiled in 32-bit takes lesser memory. For example, a pointer in 64-bit machine is 8 bytes compared to 4 bytes with 32-bit. Now imagine how many pointers do you have going around in your code?

When to not use 64-bit?

Sometimes if your code is running on a machine that does not have too much of space then it is a never a great idea to use 64-bit compilation because the same task can probably be done much better using 32-bit version. L2 and L3 caches will be utilized a lot more in 64-bit code (and a lot earlier as well) compared to 32-bit; on such systems.

Summary

Always benchmark your code and ensure that the application actually needs more than 2-4Gb of space.

comments powered by Disqus