Click to See Complete Forum and Search --> : x86 vs x64


dannystommen
November 12th, 2008, 08:40 AM
When using Visual Studio 2008, under Project properties tab Build you can set the 'Platform target' to x86, x64 or Any CPU.

I never paid eny attention to this, untill now, because my OS changed from x86 to x64. When I compile an application with platform target 'Any CPU', does this mean that my application runs both under x64 and x86, or should I compile 2 diferent versions, 1 for x64 OS and 1 for x86 OS?

TheCPUWizard
November 12th, 2008, 08:52 AM
"Any CPU" will generate MSIL that can JIT to either environment, but take no advantage of either. x86 and x64 force that environment [and x86 will run on an x64 platform, but as a 32 bit application.

Just remember that (in general) x64 means bigger and slower applications.

What you GAIN is a larger virtual address space. If your machine has <=4GB of RAM, you are likely to see an overall performance decrease. The same applies if your "typical running condition" is under 3GB total virtual address space.

The benefits (again, typically) start to appear when you have 8GB-64GB (or more) on RAM on your machine.

boudino
November 13th, 2008, 02:08 AM
Does it mean that x86/x64 build doesn't produce IL code, in other words, output assemblies are like processed with ngen.exe? (A have no experience with this, I have never need it, But I'm courious).

TheCPUWizard
November 13th, 2008, 08:15 AM
Does it mean that x86/x64 build doesn't produce IL code, in other words, output assemblies are like processed with ngen.exe? (A have no experience with this, I have never need it, But I'm courious).

Not at all. It is ALWAYS MSIL.

The different targets will (most likely) produce Different MSIL, but even more critically will include metadata that is specific to the target and used by the Loader & JIT.