Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: chet@watson.ibm.com
To: Jerome Vouillon <Jerome.Vouillon@inria.fr>
Cc: caml-list@inria.fr, chet@watson.ibm.com, blo.b@infonie.fr
Subject: Re: Efficency in OCaml
Date: Wed, 01 Sep 1999 14:40:21 -0400	[thread overview]
Message-ID: <199909011840.OAA01846@bismarck.chet.org> (raw)
In-Reply-To: Your message of "01 Sep 1999 13:28:31 GMT." <7qj9lv$aa9$1@goldenapple.srv.cs.cmu.edu>


Jerome,

Is there a description of the Ocaml object and
"virtual-function-table" format?

Also, well, I think there's been some recent work on analyzing the
path-length of O-O code, and the conclusion has been that in fact,
methods do just "call one other" a lot.

That is, while C code is characterized by lots of tests and longer
path-lengths per function-body, C++ (and Java, *especially* -- geez,
it seems like Java code is all method-calls!) code tends to be short
code-bodies, with branches implemented effectively by calling virtual
functions.

I've had the opportunity to look at a *lot* of Java code in the past
few years, and it displays this trend to an extreme.  And to my
horror.

--chet--

>>>>> "JV" == Jerome Vouillon <Jerome.Vouillon@inria.fr> writes:

    JV> The type checking is done at compile time, but method dispatch
    JV> is always dynamic : there is indeed something similar to a
    JV> virtual function table. Therefore, a method invocation is
    JV> rather fast but not as fast as a function call. A great part
    JV> of the cost of method invocation also comes from the fact that
    JV> the method which must be called is not know at compile time
    JV> (function calls are must cheaper in Ocaml when the function is
    JV> known).

    JV> This does not really matters, however, as long as your program
    JV> does not spend its time making method invocations. I think
    JV> this is rare, even in a program making heavy use of objects :
    JV> usually, methods do something, and not just call one another.

    JV> -- Jrme





       reply	other threads:[~1999-09-02 18:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <7qj9lv$aa9$1@goldenapple.srv.cs.cmu.edu>
1999-09-01 18:40 ` chet [this message]
1999-09-01 23:09   ` Jerome Vouillon
1999-09-04 14:26     ` Nicolas Ollinger
1999-09-10 13:14       ` Jerome Vouillon
1999-09-10 15:19     ` Hendrik Tews
1999-09-10 19:03       ` chet
1999-09-15 12:39       ` Jerome Vouillon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199909011840.OAA01846@bismarck.chet.org \
    --to=chet@watson.ibm.com \
    --cc=Jerome.Vouillon@inria.fr \
    --cc=blo.b@infonie.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox