caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Function Indirection overhead?
@ 2003-01-24  7:21 Vaibhav Bhandari
  2003-01-24 10:34 ` Xavier Leroy
  0 siblings, 1 reply; 2+ messages in thread
From: Vaibhav Bhandari @ 2003-01-24  7:21 UTC (permalink / raw)
  To: caml-list

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?

Does anyone know?  How can we find out?  A benchmark?

regards,
vaibhav

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Caml-list] Function Indirection overhead?
  2003-01-24  7:21 [Caml-list] Function Indirection overhead? Vaibhav Bhandari
@ 2003-01-24 10:34 ` Xavier Leroy
  0 siblings, 0 replies; 2+ messages in thread
From: Xavier Leroy @ 2003-01-24 10:34 UTC (permalink / raw)
  To: Vaibhav Bhandari; +Cc: caml-list

> 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-01-24 10:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-24  7:21 [Caml-list] Function Indirection overhead? Vaibhav Bhandari
2003-01-24 10:34 ` Xavier Leroy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).