Develop for x86 and x64 platforms

More and more operating systems have prioritized the "Version" 64bits, with this, the development of applications for this architecture becomes increasingly attractive.

  • based on this scenario, I come to ask What are the advantages/disadvantages of developing for the x64 platform?
  • to take advantage of this architecture is necessary some kind of specific application, ex: editing images, Games, etc?
  • my project is set to Platform target: Any Cpu will I automatically have version 32 and 64bits?
Author: Maniero, 2016-01-07

1 answers

In general it does not need anything specific, even more so in .NET that turns on which platform it will run . Of course there may be some incompatibilities with things that are external to .NET and are in 32 bits . Native code has more difficulty matching the two forms, even if possible. .NET compiles to native code the way you tell it to run and turns around to make everything work within it.

.NET will adjust the application to what is more suitable where it runs. The rules can change. The default was to try to use 32-bit whenever possible (loaded in a 32-bit process) but I don't know if it has changed in newer versions. You can configure this on the target machine.

In most cases will not cause problems, but some say that the ideal is to choose a platform or another, but I do not know if this is still valid. Of course this has its drawbacks.

Advantages

The biggest advantage of using 64 bits is the possibility of addressing more than 4GB of memory. Which in practice means being able to access more than 2GB of memory in the same application.

Another advantage is that some processor instructions and registers can be accessed in this mode, it can have a higher performance and do some extra things. Especially large number calculations can be done in fewer cycles. "Long" integers and double-precision numbers fit on the recorder. This is not the same thing as saying that the application will be faster. Look at the downsides.

We can also count as an advantage the fact of running directly on 64-bit operating systems without adaptations.

Another advantage that is not intrinsic, but in practice it is happening with .NET and before it was a disadvantage, everything that was for 64 bits was something Second Class . Now investments are being made in the tools for this architecture. And they are using more modern techniques. More and more we will have better tools for 64 bits than for 32 bits. A clear example is the new JITter (what is ).

Disadvantages

Not everything is flowers.

Memory consumption increases since every addressing needs 8 bytes instead of 4. It's nothing that makes such a difference in almost every case. If you usually adopt the rule of only using a 32-bit operating system with a machine with at least 4GB of memory.

This may mess up the cache a bit, which today is one of the things that help performance the most. The larger the information, the less it fits in the cache, which is quite small. This is a real problem that people often neglect. The same goes for firing the garbage collector and pressing the stack .

If the operating system is 32-bit, it does not run. Which is not a problem for .NET, because it can choose. Unless the application requires a memory consumption above 2GB.

Complement . differences .

 7
Author: Maniero, 2020-10-09 16:44:02