From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id UAA06628 for caml-redistribution; Thu, 2 Sep 1999 20:44:17 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id UAA20425 for ; Wed, 1 Sep 1999 20:42:18 +0200 (MET DST) Received: from igw3.watson.ibm.com (igw3.watson.ibm.com [198.81.209.18]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id UAA29752; Wed, 1 Sep 1999 20:42:16 +0200 (MET DST) From: chet@watson.ibm.com Received: from mailhub.watson.ibm.com (mailhub.watson.ibm.com [9.2.250.97]) by igw3.watson.ibm.com (8.9.3/8.9.3/05-14-1999) with ESMTP id OAA06366; Wed, 1 Sep 1999 14:42:09 -0400 Received: from bismarck.chet.org (nyc-46.nyc.ibm.com [9.38.112.46]) by mailhub.watson.ibm.com (8.8.7/Feb-20-98) with ESMTP id OAA29984; Wed, 1 Sep 1999 14:40:48 -0400 Received: from bismarck.chet.org (chet@localhost [127.0.0.1]) by bismarck.chet.org (8.8.8/8.8.8/Debian/GNU) with ESMTP id OAA01846; Wed, 1 Sep 1999 14:40:21 -0400 Message-Id: <199909011840.OAA01846@bismarck.chet.org> To: Jerome Vouillon Cc: caml-list@inria.fr, chet@watson.ibm.com, blo.b@infonie.fr Subject: Re: Efficency in OCaml In-reply-to: Your message of "01 Sep 1999 13:28:31 GMT." <7qj9lv$aa9$1@goldenapple.srv.cs.cmu.edu> Date: Wed, 01 Sep 1999 14:40:21 -0400 Sender: weis 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 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