Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: 2003-11-13 (09:06)
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

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


Richard Jones.
Merjis Ltd. - improving website return on investment
PTHRLIB is a library for writing small, efficient and fast servers in C.
HTTP, CGI, DBI, lightweight threads:

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: