Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Executable size?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] Executable size?
On Thu, Nov 13, 2003 at 07:14:15AM +0300, Kamil Shakirov wrote:
[bogus hello world example]

There are two factors which are actually important when comparing
executable size:

(1) How space efficient are the two compilers when compiling similar code. You
    would have to compare things like two functions which performed the same
    operation, or two equivalent for loops, etc. It's likely that OCaml must
    generate a bit more machine code, because (a) it has to add various
    run-time bounds checks, and (b) it has to do more bit shifts and boxing
    because of the representation of OCaml values.

(2) How much less code do you have to write in OCaml because it has efficiency
    features like polymorphism, garbage collection, data structure matching and
    so on. These features means you have to write, & hence compile, less code
    overall.

I would suggest that (2) outweighs (1), but I've not measured it.

Rich.

-- 
Richard Jones. http://www.annexia.org/ http://freshmeat.net/users/rwmj
Merjis Ltd. http://www.merjis.com/ - improving website return on investment
PTHRLIB is a library for writing small, efficient and fast servers in C.
HTTP, CGI, DBI, lightweight threads: http://www.annexia.org/freeware/pthrlib/

-------------------
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