English version
Accueil     Ŕ propos     Téléchargement     Ressources     Contactez-nous    
Browse thread
[Caml-list] OCaml popularity
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Michal Moskal <malekith@p...>
Subject: Re: [Caml-list] ocamlopt speed (was Re: Module recursion)
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