amd64 slower than i386 on identical AMD 64 system? / How is hyperthreading handled on amd64?

Coleman Kane zombyfork at
Thu Mar 16 16:52:18 UTC 2006

On 3/16/06, JoaoBR <joao at> wrote:
> On Wednesday 15 March 2006 18:56, Peter Wemm wrote:
> > I tend to agree with this.  ubench is not a useful benchmark for
> > comparing 32 bit vs 64 bit systems.
> >
> > However, what might be interesting is to compile a 32 bit binary (and
> > statically link it) on the i386 system, and compare the runtime on the
> > 64 bit kernel, using the same identical binary.  That way you are
> > measuring the same math operations on both platforms.  Comparing 64 bit
> > operations vs 32 bit operations is apples vs oranges.
> >
> > Of course, it may still be slower, but at least the results would be
> > more meaningful.  Don't assume the OS is slower because the compiler
> > makes the application do twice the work.
> good point
> what do you think of unixbench since it does some real-life tasks?
> João

I think that you need to determine what comparison is being made. What
aspect of the CPUs are you trying to benchmark? Then, do some investigation
into what benchmarks will demonstrate your performance comparison. ubench
may show that my amd64 mode OS is slower on its tests, but when I run make
buildworld with a common TARGET_ARCH, my amd64 setup wins out....and I know
that's less scientific... but there must exist scientific benchmarks that
demonstrate this. I do a lot of development, A LOT. This involves not only
lots of gcc, lex, yacc, make, perl, java, etc... it generally involves lots
of operations on large sets of data, building large data trees, and all
hordes of other algorithmic fun.

Earlier you stated: "Since some time (>6.0R) I have the impression that
amd64 runs slower than i386. Now I run some tests on identical hardware and
using ubench confirmes this. Somebody has comments on this?"

I suppose a good place to start is "What were you expecting?", "Why were you
expecting that?", and "What is problematic about the results that you

IMO, I don't expect many of the normal day to day operations on my amd64
machine to be significantly faster than if it were running an i386 kernel.
Due to the differences between the two (amd64 and ia32) architectures, it is
quite likely that certain operations will be faster on one than on the other
(and not broadly assume that amd64 will always at least be as well
performing as ia32 mode).

One good point is that, for instance, in ia32 mode you can fit twice as many
possible 'values' in your cache than in amd64 mode. Also, types of long are
the same length as pointers and "int"s in ia32, while only long and pointers
are the same length in amd64. So you're amd64 vs. ia32 code in many cases
can be longer and less cache-nice. These considerations need to be taken
into account when analyzing performance benchmarks.

I agree with Peter though, regarding the i386 static build. Try that and see
how it fares. My expectation is that the numbers will still be slightly
under for the amd64 case, but I could be wrong.

More information about the freebsd-amd64 mailing list