Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
From: Markus Mottl <markus@o...>
Subject: Re: [Caml-list] Does Caml have slow arithmetics ?
On Fri, 09 Jul 2004, Alex Baretta wrote:
> I'll have to verify that nowhere in my code do I use functions with more 
> than seven arguments. If need be, I'll have to compact the arguments 
> into tuples or records so as to stay within the tail-call optimization 
> limit. Yet, although this is feasible and probably will have a minimal 
> impact on my code, I still believe that ocamlopt should do anything it 
> can to perform proper tail-call optimization all the time.

I disagree here, because this would lead to inefficiencies.  Throwing
things on the stack is still much more efficient than heap allocation.
Since the OCaml-compiler can never rule out potential recursion (think
of references containing functions, etc.), it would always have to use
heap allocation with functions having more than six parameters.

I do have some functions that take more than six parameters, but none of
them is recursive.  It would be pointless to make calling these functions
less efficient, only because IA-32 sucks.

Regards,
Markus

-- 
Markus Mottl          http://www.oefai.at/~markus          markus@oefai.at

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