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
Re: Ocaml for Scientific computing
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-09-26 (08:53)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] Re: Ocaml for Scientific computing
On Wed, 2007-09-26 at 10:27 +0200, Florian Hars wrote:
> skaller schrieb:
> > I guess that this is easier. How much speed is gained eliding
> > bounds checks?
> It may even make the code slower:

Yes, I tend to agree with Xavier's analysis.
This may also explain why C code generated by Felix is 
often faster than hand written C code: on AMD64 Felix
generated C code for Ackermann's function is almost the same
as the hand written C, but runs 2x faster, and 2.5x faster
than Ocamlopt generated code.

At this point with gcc as the compiler and using stack
programming (no heap), I'm now expecting Felix to beat
C on all programs (and if it doesn't it's a bug 
in the compiler that needs fixing).

I am guessing this is because GCC has good SSA analysis,
and it works a lot better on goto spaghetti with a fixed
stack frame of the kind Felix tends to generate, than
block structured C code using for loops, etc.

So I'd add to Xaviers comments on processor behaviour
that small differences in source code structure can make
a big difference to compiler technology.

John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: