Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
From: Markus Mottl <markus@o...>
Subject: Re: [Caml-list] O'Caml vs C++: a little benchmark
On Sun, 18 Aug 2002, Oleg wrote:
> 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.

And deteriorated it in others:

  lists
  1.480
  0.650
  2.400
  arrays
  0.380
  3.040
  rev
  0.490
  0.040
  memory
  0.600
  2.000
  tree
  1.280
  2.750

Btw., the last timing of the tree is a result of adding a type restriction
to floats to the "insert" function ("(x : float)"). This way we benefit
from unboxing.

> > 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).

Sorry, I had mistakenly thought that you used the persistent version.

Regards,
Markus Mottl

-- 
Markus Mottl                                             markus@oefai.at
Austrian Research Institute
for Artificial Intelligence                  http://www.oefai.at/~markus
-------------------
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