Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

64-bit Performance Advantages

What is the source of the performance advantage 64-bit applications have over 32-bit applications? I'm assuming there is a performance advantage because programs like WinRAR advertise it.

Also, can we get these performance advantages simply by switching to a 64-bit compiler, or are there any changes in code that need to be made?

Answers related to both, unmanaged and managed code, are welcome.

like image 413
TripShock Avatar asked Jul 27 '10 12:07

TripShock


People also ask

Does 64-bit improve performance?

Large amounts of memory can be handled more efficiently by a 64-bit operating system as compared to a 32-bit system. In terms of responsiveness, a 64-bit system can be more responsive and can smoothly run several programs at the same time, and seamless switching can be done between the running programs frequently.

What is the main advantage of 64-bit?

Computer Performance Using 64 bit operating system with 64 bit processer, the system can perform an increased number of calculations per second. As a result, it increases the processing power and makes a computer run faster. This is limited in case of 32 bit operating system.

What is the advantage and disadvantages of 32-bit to 64 bits?

32-bit processors need a 32-bit operating system whereas 64-bit processors can run either on 32 or 64 64-bit operating systems. 32-bit processors is not an ideal option for stress testing and multi-tasking whereas 64-bit processors are best for performing multi-tasking and stress testing.

What is the biggest advantage of 64-bit processors over 32-bit processors?

The biggest advantage of 64-bit processors over 32-bit processors is in the amount of memory they can use. 32-bit processors have a limit of 4 GB. 64-bit processors have a theoretical limit of 16 EB. 32-bit processors use the IA-32 instruction set (also referred to as x86).


2 Answers

The x64 architecture doubles the number of general purpose registers available in the x86 architecture, so that compilers are able to keep more data in (very fast) CPU registers rather than in (relatively slow) RAM.

like image 74
Ferruccio Avatar answered Nov 10 '22 00:11

Ferruccio


In order to take advantage of the 64 bit architecture of the latest CPU's you have to:

  • use a 64 bit CPU and OS
  • develop specifically for 64 bits using a 64 bit api - the implementation has to go all the way down to the most basic code working with the CPU registers (normally written in assembler) to take advantage of the extra registers.
  • develop an application that will really benefit from the extra registers - WinRAR is an application that will take full advantage of the extra registers because it involves a lot of calculus with complex algorithms. If you instead write an application with very simple algorithms, it will not require extra register address space and it will not work faster on 64 bit
  • take also into consideration that when you use a CPU register even if you don't use the the whole address space for a value, it will still take up as much space ( = 64bits).. therefore writing a small application in 64 bit aiming for getting a optimized code will just not work.. that app will take up twice the RAM than if it would be developed under 32 bit and it may be even slower. Programming in 64 bit makes sense for applications using heavy algorithms or that need to allocate huge pieces of memory (4Gb is the limit for a 32bit app).
like image 34
Ioan Paul Pirau Avatar answered Nov 10 '22 00:11

Ioan Paul Pirau