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] 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 Archives:
Bug reports: FAQ:
Beginner's list: