Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] speed
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Xavier Leroy <xavier.leroy@i...>
Subject: Re: Coyote Gulch test in Caml (was Re: [Caml-list] speed )
> http://raevnos.pennmush.org/code/almabench-ocaml.tar.gz
> It's pretty much a straight translation of the C++ version, and not very
> impressive speed-wise on my system compared to the C++ one.

Thanks a lot for the OCaml translation.  As you say, the speed of the
OCaml version is about 50% of that of the C++ version, both on Athlon
with g++, and on Alpha with the Tru64 cxx compiler.  This is both
reassuring and disappointing:

Reassuring, because our blanket performance statement "OCaml
delivers at least 50% of the performance of a decent C compiler" is
not invalidated :-)

Disappointing, because the assembly code generated by ocamlopt isn't
too ugly despite the code not being very Caml-ish in style.  In
particular, (almost) all float and ref boxing is correctly eliminated.
Given this, I was expecting maybe 75% of the performances of C++, not
50%.  Simple hand optimization (CSE, loop unrolling) doesn't affect
the speed significantly.  Apparently, the ocamlopt-generated code
offers less instruction-level parallelism than the g++-generated code
for the float computations.  Still, I haven't really understood where
the factor of 2 comes from.  

Thanks again for an interesting benchmark,

- Xavier Leroy
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners