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 JAA03692; Thu, 5 Sep 2002 09:57:17 +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 JAA03775 for caml-list@pauillac.inria.fr; Thu, 5 Sep 2002 09:57:17 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id NAA14268 for ; Wed, 4 Sep 2002 13:57:51 +0200 (MET DST) Received: from comtv.ru (comtv.ru [217.10.32.4]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g84Bvo107854 for ; Wed, 4 Sep 2002 13:57:50 +0200 (MET DST) Received: from [10.0.66.9] ([10.0.66.9] verified) by comtv.ru (CommuniGate Pro SMTP 3.5.9) with ESMTP-TLS id 4346403 for caml-list@inria.fr; Wed, 04 Sep 2002 15:57:43 +0400 Date: Wed, 4 Sep 2002 15:57:33 +0400 (MSD) From: malc X-X-Sender: malc@home.oyster.ru To: caml-list Subject: [Caml-list] O'Caml vs C++: a little benchmark revisited Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk First line for each test shows icc(gcc)'s timing, second ocaml's lists 0.903(1.201) 1.304 arrays 0.397(0.397) 1.200(0.829 if loop was unrolled) rev 4.707(14.073) 2.892 memory 1.191(1.069) 1.793 tree 1.064(0.854) 6.737(2.400 in case of manual/functor specialization) lists deque 1.570(0.758) Modified sources: http://algol.prosalg.no/~malc/silly.tar.gz (Linux kernel patch 2.4.19 was used for rev test) Conclusion. C++: Tends to optimize out some computations if the result wasnt used. Strings/streams are slow. OCaml: Polymorphic functions are slow. Insn scheduler is less than perfect. One must learn to live with existing floating point constraints. -- mailto:malc@pulsesoft.com ------------------- 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