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 LAA16717; Wed, 19 Mar 2003 11:06:12 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 LAA16552 for ; Wed, 19 Mar 2003 11:06:10 +0100 (MET) Received: from ep09.kernel.pl (ep09.kernel.pl [212.87.11.162]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h2JA69X18082 for ; Wed, 19 Mar 2003 11:06:09 +0100 (MET) Received: (qmail 26935 invoked by uid 566); 19 Mar 2003 10:06:06 -0000 Date: Wed, 19 Mar 2003 11:03:05 +0100 From: Michal Moskal To: Chris Hecker Cc: caml-list@inria.fr Subject: Re: [Caml-list] ocamlopt speed (was Re: Module recursion) Message-ID: <20030319100305.GA3868@roke.freak> References: <4.3.2.7.2.20030316205959.045990d8@localhost> <4.3.2.7.2.20030318182012.03a87480@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4.3.2.7.2.20030318182012.03a87480@localhost> User-Agent: Mutt/1.4i X-PGP-Fingerprint: CF89 1B14 11BE 1CC9 2CA3 7497 5E32 69B4 BC71 B4C2 X-AntiVirus: scanned for viruses by AMaViS 0.2.1 (http://amavis.org/) X-Spam: no; 0.00; michal:01 moskal:01 malekith:01 pld-linux:01 caml-list:01 ocamlopt:01 recursion:01 hecker:01 shootout:01 verbose:01 hash:01 wroclaw:01 compiler:01 chris:01 ocaml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tue, Mar 18, 2003 at 06:34:29PM -0800, Chris Hecker wrote: > Here are the results on this machine, which shows ocamlopt.opt just about > matching msvc6. This isn't trying to be a formal test, so I don't account > for things like the difference in code complexity (they're both games), My experience shows that ocaml code is very often twice (or more) as short as C equivalent. For example for language shootout sources: language loc ~~~~~~~~~~~~~~~~~~~ ansic: 1403 cpp: 1107 ml: 646 Of course one may argue, that for bigger programs C gets less verbose (once you have written lists, hash tables, trees etc). > system headers included in C files (which would favor C if they were > cleaned up) or the fact that my makefile for caml doesn't pass multiple ml > files to the compiler (which should favor ocamlopt), etc. In case of C compiler you should enable precompiled headers (if it supports one), because ocaml compiler uses some form of it. > compiler sec loc loc/sec > ------------ --- ----- ------- > msvc6 12 27865 2322 > ocamlopt 13 15483 1191 > ocamlopt.opt 7 15483 2211 Combined with semantic density, this makes ocamlopt twice as fast as msvc. -- : Michal Moskal ::::: malekith/at/pld-linux.org : GCS {C,UL}++++$ a? !tv : PLD Linux ::::::: Wroclaw University, CS Dept : {E-,w}-- {b++,e}>+++ h ------------------- 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