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 LAA17835; Wed, 19 Mar 2003 11:37:20 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 LAA17951 for ; Wed, 19 Mar 2003 11:37:18 +0100 (MET) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.187]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h2JAbHf04340 for ; Wed, 19 Mar 2003 11:37:17 +0100 (MET) Received: from [212.227.126.160] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 18vawc-0008Ua-00; Wed, 19 Mar 2003 11:37:14 +0100 Received: from [80.129.100.174] (helo=gate.gerd-stolpmann.de) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 18vawc-0000Dd-00; Wed, 19 Mar 2003 11:37:14 +0100 Received: from mydomain.com (localhost [127.0.0.1]) by gate.gerd-stolpmann.de (Postfix) with SMTP id BC0A95717; Wed, 19 Mar 2003 11:38:00 +0100 (CET) Received: from 193.194.7.77 (SquirrelMail authenticated user gerd) by gps.dynxs.de with HTTP; Wed, 19 Mar 2003 11:38:01 +0100 (CET) Message-ID: <54539.193.194.7.77.1048070281.squirrel@gps.dynxs.de> Date: Wed, 19 Mar 2003 11:38:01 +0100 (CET) Subject: Re: [Caml-list] ocamlopt speed (was Re: Module recursion) From: "Gerd Stolpmann" To: In-Reply-To: <20030319100305.GA3868@roke.freak> References: <4.3.2.7.2.20030316205959.045990d8@localhost> <4.3.2.7.2.20030318182012.03a87480@localhost> <20030319100305.GA3868@roke.freak> Cc: , X-Mailer: SquirrelMail (version 1.2.6) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Spam: no; 0.00; gerd:01 stolpmann:01 caml-list:01 ocamlopt:01 recursion:01 hecker:01 shootout:01 verbose:01 hash:01 slower:01 compilations:01 inference:01 subtyping:01 viktoriastr:01 64293: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. Sorry that I must say that, but these comparisons are absolutely nonsense. I have some ocaml sources that are _much_ slower (e.g. 2500 lines, but compilations take longer than 20 seconds), and I know that you can slow down C++ compilers by turning on optimization switches. So the question arises: which features take which time? My impression is that some type inference tasks can be very slow for ocaml, especially if subtyping is involved. This feature is not available in C++. On the other hand, C++ compilers usually implement better optimization techniques, and these take time, too. Gerd ------------------------------------------------------------ Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany gerd@gerd-stolpmann.de http://www.gerd-stolpmann.de ------------------------------------------------------------ ------------------- 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