English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] O'Caml vs C++: a little benchmark
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-08-18 (19:58)
From: Oleg <oleg_inconnu@m...>
Subject: Re: [Caml-list] O'Caml vs C++: a little benchmark
On Sunday 18 August 2002 03:16 pm, Markus Mottl wrote:

> My timings differ considerably (AMD Athlon 800 MHz 256 MB RAM; g++-2.96;
> demo_all.sh instead of demo_all_root.sh):

g++-3.2 removes abstraction penalty related to iterators, etc.

> Note, btw., that I have measured user time: real time, which you have
> chosen is just too unstable on my machine. 

On my machine/OS (Linux 2.4), user and real time are usually the same for 
ocaml, but can differ somewhat for C++ (probably because malloc/free is done 
by the kernel or something, I wouldn't know). Had I used user time, it would 
have steered the results in favor of C++ a little more in some cases.

> Not on my machine / with my compiler. Btw., not very fair of you to
> compare ephemeral and persistent datastructures... ;-)

I'm not! Both tree_mutable_ml.ml and tree_cpp.cpp contain mutable binary 
trees. I think your C++ tree is slower than mine because of the old compiler
(Or maybe it's the OS: tree allocates a lot of small objects).

> Look at the assembler output for details... ;-)

IANAAP (I am not an assembly programmer :)


P.S. It looks like List and Array iteration is somehow much faster on Athlon 
than P3 Xeon.
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