Browse thread
Re: Ocaml for Scientific computing
-
Mike Lin
-
skaller
-
Jon Harrop
-
skaller
-
Florian Hars
- skaller
-
Florian Hars
-
skaller
-
Jon Harrop
-
skaller
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ 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: > > http://caml.inria.fr/pub/ml-archives/caml-list/2004/01/679987f7b8b70e4cd9f088ac4e6c8097.en.html 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++: http://felix.sf.net