Sunday, August 15, 2010

Moving to 64 bit Computing

The 64 bit architectures history dates back to 1970's on RISC based Servers but is relatively new to x86 (32 bit) architecture space.
Intel shipped it first 64 bit processor (x86-64) in form of pricey Itanium Servers but Itanium did not live up to its hype. However it was when AMD introduced cheaper 64 bit Opteron processor for servers and Athlon 64 for workstations and desktop that 64 bit computing finally arrived to large arena. It is only then the 64 bit processors started gaining operating system support to exploit their functionality.

Most of the legacy applications which exist today or even ones which some developers are developing are 32 bit applications. Even though we have 64 bit operating system support on 64 bit hardware, there does not seem to be an urgency in dev community to port their 32 bit applications to 64 bit computing. The main reason which the developers may cite:

  • My application is not memory hungry and will fit in within 4 GB of virtual address space.
  • I do not use 64 bit data types (long, longlong, double etc),
  • Since i use none of the 64 bit features, why unnecessarily burden my 32 bit application with 64 bit overhead.

Apart from the concerns which developers have, one disadvantage of 64-bit architectures relative to 32-bit architectures is that the same data occupies more space in memory due to swollen pointers . In 32 bit the pointer is 32 bit in size while as in 64 bit the pointer is 64 bit in size. This increases the memory requirements of a given process and can have implications for efficient processor cache utilization.

While the concerns of a developer may me valid in some cases, let us look at the advantages which 64 bit has to offer over 32 bit:
  1. System architecture on Intel x86 (32-bit architecture) limits virtual memory space to 4 GB, This is not present in 64-bit architectures, which can use 4 GB of memory and more.
  2. Memory-mapped files with sizes more than 4Gb are becoming more difficult to implement in 32-bit architectures. However on a 64 bit architecture this is not an issue.
  3. Floating-point operations in 64 bit are implemented using a register-oriented instruction set, rather than the stack-based approach supported by x86.
  4. In 64 bit architectures (x86-64), the set of general-purpose registers is expanded from 8 in 32 bit (x86) to 16. Hence much of the program state is held in registers rather than on the stack effectively increasing the performance. Some procedures do not need to access the stack at all.

The last two points are very important form the performance perspective and should give you enough reasons to recompile your 32 bit application in 64 bit. Lot of applications when recompiled in 64 bit are often better than its counter part in 32 bit like latency performance tests. The difference is markedly visible in CPU intensive applications (throughput applications).

So there should be an urgency in porting 32 bit application (x86) to 64 bit platforms (x86-64) quickly to gain upon the performance benefit which the 64 bit computing has to offer.

No comments: