x86 64bit performance increase

Normally the performance gain going from 32bit (i386, aka i686 etc.) code to 64bit amd64 (aka x86-64, EM64T, or the likely to mismatch x64, …) is not soo huge. However, unlike classic RISC CPUs -which usually loose performance when comparing their 32 and 64-bit- code due to bigger instructions and thus data bus saturation. For amd64 AMD did a great job defining the ISA (Instruction Set Architecture) in a way that 32 and 64bit operations can be freely mixed. Thus normal programs that do not benefit from 64bit operations remain compact, while single instruction can freely utilize 64bit by adding a REX prefix (similar to the 0×66 prefix introduced with the 386). So normally data moving loops benefit from going 64bit, e.g. multi media codecs, encryption and such.

Doing some performance analysis on a new AMD board I spotted an rather extreme case: openssl’s RSA 2048 bit encryption shows an over 300% boost while going 64bit:

From:

rsa 2048 bits 0.007128s 0.000212s 140.3 4722.2

To:

rsa 2048 bits 0.002380s 0.000068s 420.1 14716.7

Yes, that the same machine (AMD Phenom II), exactly same software stack and such, a whooping 312% increase!!!

Leave a Reply

You must be logged in to post a comment.