Win32 vs x64 ?

Started by
6 comments, last by Ryan_001 10 years, 8 months ago

So I was setting up a new project in visual studio 2010 and I notice there is this option to develope either Win32 or x64 apps. I was wondering like what is the pros and cons of these two and like whats the difference I guess. I mean I would assume that x64 is better but I think that might just be my naivete of the subject getting the best of me.

J-GREEN

Greenpanoply
Advertisement

32-bit applications will run on both 32-bit and 64-bit versions of Windows whereas 64-bit applications will only work on 64-bit versions.

One advantage that 64-bit applications can afford is a potential performance boost and another is that they can exceed the 32-bit memory limit, allowing them to use more than 4GB (the limit varies depending on hardware and OS).

For small personal projects, it usually doesn't matter which you choose.

main advantage of x64 builds over ia32 build (named "win32" in visual studio) could be (depending on the application):

- using and access more then 2GiB of virtual memory (or 3/4 GiB with largeaddressware respectively for 32 and 64 bit version of windows)

- access to more CPU registers

- be sure that all systems run you application support SSE2 (and somthing like 99.89% support also SSE3)

- SSE2 automatic optimizations by visual studio.

disadvantage:

- some legacy 3rd party libraries simply don't support x64

- pointers are 64 bit length instead of 32 (more memory needed and potential issues with bad coding, ie storing pointer values into integers)

- portability issues (ie: LLP64 vs LP64)

- if you don't provide a 32-bit build you could cut a lot of usage share in real word market.

"Recursion is the first step towards madness." - "Skegg?ld, Skálm?ld, Skildir ro Klofnir!"
Direct3D 12 quick reference: https://github.com/alessiot89/D3D12QuickRef/

I guess my next question on the topic would be, If I am writing a game to be run on a high end Nvidia graphic card set up, would I want to write that in x64. I mean if i am assuming the consumer has a rig to run it then they would probably have 64 bit OS right?

J-GREEN

Greenpanoply

Except for people aiming for a very high-tech games engine like let's say CryEngine/Unreal, you probably will never reach the memory limit and the small performance boost advantage is not worth the compatibility/portability issues you will encounter. Almost all games even nowadays are built in 32bits only, and some rare offers both the 32bits and the 64bits executable file, but I don't think I ever saw any game offering only a 64bits version. In any case, you can always switch it anytime to see how it's different during your development.

As an exercise, just look on your own computer what's installed in the "Program Files (x86)" (32bits) folder versus the "Program Files" folder (64bits). Most of what is installed in the 64bits version are Microsoft programs, drivers and some high-end applications like Autodesk's ones.

a few years back, I was building most of my stuff for x64: "yay, finally free from the address space limits".

then I was like "but, it doesn't work on my 2003-era laptop running Windows XP...".

I then returned to doing 32-bit builds.

a few times I have considered returning to doing 64-bit builds, namely to be free again of these memory-usage limits, but generally have been finding ways to put it off (tricks to shave off memory use, ...).

granted, the usage of 32-bit OS's is fading, so it probably wont be an issue for too much longer.

Perhaps not so relevant for personal projects but compiling for 64-bit usually makes your software harder to crack due to less tools being readily avaliable which support 64-bit extensions (OllyDbg for one) laugh.png

http://tinyurl.com/shewonyay - Thanks so much for those who voted on my GF's Competition Cosplay Entry for Cosplayzine. She won! I owe you all beers :)

Mutiny - Open-source C++ Unity re-implementation.
Defile of Eden 2 - FreeBSD and OpenBSD binaries of our latest game.
I use both for all my projects. Its very easy and requires almost no extra work. That said according to the latest steam survey more than 70% of windows systems are 64-bit.

This topic is closed to new replies.

Advertisement