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
Re: Efficency in OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 1999-09-10 (17:23)
From: Hendrik Tews <tews@t...>
Subject: Re: Efficency in OCaml

Jerome Vouillon writes:
   From: Jerome Vouillon <>
   Date: Thu, 2 Sep 1999 01:09:39 +0200
   Subject: Re: Efficency in OCaml
   Each object holds a table containing its methods (the table is shared
   among all objets of a same class). A unique integer is assigned at
   run-time to each method name of a program.  This integer is used as an
   index in this table to find the method. As the table is rather sparse,
   it is implemented as a two-level array (an array of arrays of
   functions). So, a method call
     "object#m e1 ... en"
   is compile in something that looks like
     "object.(0).(idx mod N).(idx / N) objet e1 ... en"
   where idx is the integer associated to the method name "m".
Sorry, I don't understand this. How can the compiler know idx, if
it is not known until run-time?