From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA08235; Mon, 19 Aug 2002 15:41:37 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA08286 for caml-list@pauillac.inria.fr; Mon, 19 Aug 2002 15:41:37 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id BAA26480 for ; Mon, 19 Aug 2002 01:01:54 +0200 (MET DST) Received: from fichte.ai.univie.ac.at (fichte.ai.univie.ac.at [131.130.174.156]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g7IMxmj21528 for ; Mon, 19 Aug 2002 00:59:53 +0200 (MET DST) Received: (from markus@localhost) by fichte.ai.univie.ac.at (8.9.3/8.9.3/Debian 8.9.3-21) id AAA09729; Mon, 19 Aug 2002 00:59:02 +0200 Date: Mon, 19 Aug 2002 00:59:02 +0200 From: Markus Mottl To: Oleg Cc: caml-list Subject: Re: [Caml-list] O'Caml vs C++: a little benchmark Message-ID: <20020818225902.GB9357@fichte.ai.univie.ac.at> Mail-Followup-To: Oleg , caml-list References: <200208181716.NAA10426@hickory.cc.columbia.edu> <20020818191613.GC8185@fichte.ai.univie.ac.at> <200208181957.PAA08736@hickory.cc.columbia.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200208181957.PAA08736@hickory.cc.columbia.edu> User-Agent: Mutt/1.4i Organization: Austrian Research Institute for Artificial Intelligence Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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