Benchmarks: AMD64 vs i386 on Dual 246 Opteron

Martin Cracauer cracauer at cons.org
Thu Jul 28 23:35:31 GMT 2005


> While this sounded like a long shot, I loaded FreeBSD 5.4 i386 on the machine
> and after applying the exact same configuration to the OS, Apache, PHP and
> MySQL, re-ran the benchmarks.  Much to my surprise, just changing the OS from 64
> bit to 32 bit caused the machine to double in speed.  The results are attached
> in an Excel spreadsheet.  So the exact same machine, running the identical
> configuration, performed roughly twice as fast when running FreeBSD 5.4 i386 vs
> FreeBSD 5.4 AMD64.  Something about this seems so wrong to me :-)

I'm sorry but I cannot support these findings.  I don't have
cut'n'paste numbers handy, but generally 64 bits speed up things quite
a bit for me.  I have seen slowdown in 64 bit mode in e.g. bzip2 but
generally there is a speedup.

Data is not generally doubled in size.  Plain int stays the same in C.
Floating point stays the same.  String stays the same.  Arrays of ints
stay the same.  But e.g. lists do not.

The additonal registers are a huge deal.  While you "only" double from
8 to 16 you have to understand that not all of the 8 registers are
general-purpose.  In practice you go from 3 or 4 registers to 11 or
12 for run-of-the-mill C-compiled code.

Databases like mysql should see a speedup from having native 64 bit
integer arithmetic, which they use heavily for e.g. statistics and
general addressing other than pointers.  Php on the other hand, along
with most other scripting languages, makes heavy use of linked lists
which are pointer-intensive.

Benchmarks of 64 bits Linux versus 32 bit Linux has been published on
sites such as the Linux section of anandtech.com and linuxhardware.com
and they all verify what I write above.

I am currently setting up a quad-boot Opteron and will be able to get
cut'n'pasteable numbers soon.  I never kept my earlier ones.

%%

I highly suspect that the 64 bit version of FreeBSD in this
comparision was somehow doomed before it started.  Opportunities are
leaving in kernel safety code in one of the kernels, a driver that
just doesn't work right on AMD64.  Or the same for any of the
software, maybe php is hosed in its 64 bit build.

> I'm also wondering if there is a compiler switch on AMD64 that could be used
> (perhaps in /etc/make.conf or something) that would force the AMD64 version to
> run in 32 bit mode only - since that would be an interesting comparison as well.

-m32

You can also just copy a 32 bit installation of your benchmark suite,
if required a whole OS installation and changeroot into it.  That way
you don't have to compile.

Martin
-- 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Martin Cracauer <cracauer at cons.org>   http://www.cons.org/cracauer/
 No warranty.    This email is probably produced by one of my cats 
 stepping on the keys. No, I don't have an infinite number of cats.


More information about the freebsd-amd64 mailing list