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

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Xavier Leroy <xavier.leroy@i...>
Subject: Re: [Caml-list] Function Indirection overhead?
> I am not sure, if in ocaml we write
> 
> let f = Hop.a;
> 
> where f and Hop.a are methods, does the compiler "short-circuit" the call,
> or not?

Yes, it does.  Applications of function f will go straight to the code
for Hop.a.  Contrast this with

let f x = Hop.a x

where an additional call (from f to Hop.a) would occur.

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