Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Benchmark] NBody
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-02-08 (11:26)
From: Ville-Pertti Keinonen <will@e...>
Subject: Re: [Caml-list] [Benchmark] NBody
On Tue, 2005-02-08 at 11:43 +0100, Xavier Leroy wrote:

> The best gcc output is faster than the best OCaml output by about 30%.
> Looking at the asm code, the main difference is that gcc keeps some
> float variables (dx, dy, dz, etc) in the floating-point stack while
> OCaml stores them (unboxed) to the stack.  Maybe the Java
> implementation you used manages to use the float stack.  Who knows.

An interesting question is whether Java aligns allocations and stack to
4-byte or 8-byte boundaries on x86.

A few years ago, when keeping the stack aligned for better floating
point performance was a new gcc feature, and only worked as long as it
was aligned initially (and consistently kept it misaligned if it
wasn't), I played around with a floating point intensive C program that
would exhibit an almost 40% difference in performance depending on what
the binary was called...