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] Does Caml have slow arithmetics ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-07-08 (15:49)
From: Luc Maranget <Luc.Maranget@i...>
Subject: Re: [Caml-list] Does Caml have slow arithmetics ?

> > + ocamlc does perform tail call elimation
> > + ocamlopt does it less often. Namely, calls in tail position
> >   become real tail calls when all their arguments are passed in registers.
> >   (This does not apply to self-tail calls which are always optimized)
> > 
Oups sorry...

In fact you need 7 arguments or more in the callee to
trigger the unoptimized behavior on a pentium (just checked this time).

> What?! Is this true? This effectively means that I cannot count on 
> tail-call elimination in general?

Do not take it that bad. In practice, it does not matter much I guess.

I guess that any ocamlopt back-end passes at least the first six argument in
registers (and six is a lot).

Besides stack grow is a less severe issue in native code than it is in
byte code.  At least in Unix, the process stack may grow to important sizes.


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