<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/12/3e08ab91fe4e71aa79503c510e5bc9ce"
  from="Olivier Andrieu &lt;andrieu@i...&gt;"
  author="Olivier Andrieu"
  date="2003-12-09T13:17:42"
  subject="Re: [Caml-list] Object-oriented access bottleneck"
  prev="2003/12/10547d113f5c7fc3b3cce5c839c791a6"
  next="2003/12/3dd6d5ba05a867055d99deaa11f36a09"
  prev-in-thread="2003/12/817e19365ada8715c95560fe9bc8c459"
  next-in-thread="2003/12/53ed62c2429ea4f8799420334d0ea457"
  prev-thread="2003/12/ecaddc19e541a9809560b5db8b55c48d"
  next-thread="2003/12/53de1d81a54124f71e2d3471665fb012"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] Object-oriented access bottleneck">
<msg 
  url="2003/12/0405d2d0e46776c18d8187cc1e8db0ce"
  from="Nuutti Kotivuori &lt;naked+caml@n...&gt;"
  author="Nuutti Kotivuori"
  date="2003-12-07T02:39:16"
  subject="[Caml-list] Object-oriented access bottleneck">
<msg 
  url="2003/12/82447d9c9830bab626cd33d41137715f"
  from="Nicolas Cannasse &lt;warplayer@f...&gt;"
  author="Nicolas Cannasse"
  date="2003-12-07T02:59:23"
  subject="Re: [Caml-list] Object-oriented access bottleneck">
<msg 
  url="2003/12/3bef043c3c8b1d024a522b7968c1655e"
  from="Benjamin Geer &lt;ben@s...&gt;"
  author="Benjamin Geer"
  date="2003-12-07T11:22:07"
  subject="Re: [Caml-list] Object-oriented access bottleneck">
<msg 
  url="2003/12/068928e7f339a45342f573b34df00436"
  from="Nicolas Cannasse &lt;warplayer@f...&gt;"
  author="Nicolas Cannasse"
  date="2003-12-07T14:12:24"
  subject="Re: [Caml-list] Object-oriented access bottleneck">
</msg>
</msg>
<msg 
  url="2003/12/89629aaea615ed0841e41fd89b63c3e1"
  from="Nuutti Kotivuori &lt;naked+caml@n...&gt;"
  author="Nuutti Kotivuori"
  date="2003-12-07T18:04:33"
  subject="Re: [Caml-list] Object-oriented access bottleneck">
</msg>
</msg>
<msg 
  url="2003/12/11c4c5386a3bce4a54d51a2e9841dca0"
  from="Jacques Garrigue &lt;garrigue@k...&gt;"
  author="Jacques Garrigue"
  date="2003-12-07T10:26:19"
  subject="Re: [Caml-list] Object-oriented access bottleneck">
<msg 
  url="2003/12/b9082d28c180dae2adcc644d330d3622"
  from="Nuutti Kotivuori &lt;naked+caml@n...&gt;"
  author="Nuutti Kotivuori"
  date="2003-12-07T19:46:25"
  subject="Re: [Caml-list] Object-oriented access bottleneck">
<msg 
  url="2003/12/aea7690c5ae1dc3cf7f1ac93954dd44f"
  from="Jacques Garrigue &lt;garrigue@k...&gt;"
  author="Jacques Garrigue"
  date="2003-12-08T01:06:47"
  subject="Re: [Caml-list] Object-oriented access bottleneck">
<msg 
  url="2003/12/cb58878528d6c6c4c8bc1f70e307263c"
  from="Nuutti Kotivuori &lt;naked+caml@n...&gt;"
  author="Nuutti Kotivuori"
  date="2003-12-08T15:08:38"
  subject="Re: [Caml-list] Object-oriented access bottleneck">
<msg 
  url="2003/12/25c64c31d216a39f7c1a9b7fc10393dc"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2003-12-08T15:42:47"
  subject="Re: [Caml-list] Object-oriented access bottleneck">
<msg 
  url="2003/12/24448eaff6f7e9447b75f2bb0fae05c2"
  from="Nicolas Cannasse &lt;warplayer@f...&gt;"
  author="Nicolas Cannasse"
  date="2003-12-09T00:27:02"
  subject="Re: [Caml-list] Object-oriented access bottleneck">
<msg 
  url="2003/12/817e19365ada8715c95560fe9bc8c459"
  from="Nuutti Kotivuori &lt;naked+caml@n...&gt;"
  author="Nuutti Kotivuori"
  date="2003-12-09T12:10:12"
  subject="Re: [Caml-list] Object-oriented access bottleneck">
<msg 
  url="2003/12/3e08ab91fe4e71aa79503c510e5bc9ce"
  from="Olivier Andrieu &lt;andrieu@i...&gt;"
  author="Olivier Andrieu"
  date="2003-12-09T13:17:42"
  subject="Re: [Caml-list] Object-oriented access bottleneck">
<msg 
  url="2003/12/53ed62c2429ea4f8799420334d0ea457"
  from="Nuutti Kotivuori &lt;naked+caml@n...&gt;"
  author="Nuutti Kotivuori"
  date="2003-12-09T13:53:56"
  subject="Re: [Caml-list] Object-oriented access bottleneck">
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2003/12/70919ec4e1a6ec0e9e44915831c57798"
  from="Brian Hurt &lt;bhurt@s...&gt;"
  author="Brian Hurt"
  date="2003-12-08T16:51:11"
  subject="Re: [Caml-list] Object-oriented access bottleneck">
<msg 
  url="2003/12/66f13ce473016d9835148ed914297636"
  from="brogoff@s..."
  author="brogoff@s..."
  date="2003-12-08T18:20:12"
  subject="Re: [Caml-list] Object-oriented access bottleneck">
<msg 
  url="2003/12/4ed04b10c434786dfabeb1ac5b6a933d"
  from="Brian Hurt &lt;bhurt@s...&gt;"
  author="Brian Hurt"
  date="2003-12-08T19:09:21"
  subject="Re: [Caml-list] Object-oriented access bottleneck">
</msg>
</msg>
<msg 
  url="2003/12/e9b284a0003439f67600366eea36ef34"
  from="Xavier Leroy &lt;xavier.leroy@i...&gt;"
  author="Xavier Leroy"
  date="2003-12-08T19:02:34"
  subject="Re: [Caml-list] Object-oriented access bottleneck">
<msg 
  url="2003/12/83cb0be3da0d55eea55c4913d5dc051a"
  from="Brian Hurt &lt;bhurt@s...&gt;"
  author="Brian Hurt"
  date="2003-12-08T20:36:46"
  subject="Re: [Caml-list] Object-oriented access bottleneck">
<msg 
  url="2003/12/30111f7048f7f046073a7036d8df76d4"
  from="Nuutti Kotivuori &lt;naked+caml@n...&gt;"
  author="Nuutti Kotivuori"
  date="2003-12-08T21:06:18"
  subject="Re: [Caml-list] Object-oriented access bottleneck">
</msg>
<msg 
  url="2003/12/2fcdfadf2d12989ce7318b8a57465953"
  from="malc &lt;malc@p...&gt;"
  author="malc"
  date="2003-12-08T22:28:35"
  subject="Re: [Caml-list] Object-oriented access bottleneck">
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2003/12/014c876011e3783dfeaee4df9a9dca72"
  from="Brian Hurt &lt;bhurt@s...&gt;"
  author="Brian Hurt"
  date="2003-12-07T17:22:59"
  subject="Re: [Caml-list] Object-oriented access bottleneck">
<msg 
  url="2003/12/874d67ec980f1675d71aae30479e5186"
  from="Nuutti Kotivuori &lt;naked+caml@n...&gt;"
  author="Nuutti Kotivuori"
  date="2003-12-07T18:14:37"
  subject="Re: [Caml-list] Object-oriented access bottleneck">
<msg 
  url="2003/12/81f82f284df0b1282309ba984d8511b3"
  from="Brian Hurt &lt;bhurt@s...&gt;"
  author="Brian Hurt"
  date="2003-12-07T18:30:19"
  subject="Re: [Caml-list] Object-oriented access bottleneck">
<msg 
  url="2003/12/dc39ff38e190a026acbb9b4591886f68"
  from="Abdulaziz Ghuloum &lt;aghuloum@c...&gt;"
  author="Abdulaziz Ghuloum"
  date="2003-12-07T23:50:19"
  subject="Re: [Caml-list] Object-oriented access bottleneck">
<msg 
  url="2003/12/d82586dd21630548daff76e5154d68f3"
  from="Brian Hurt &lt;bhurt@s...&gt;"
  author="Brian Hurt"
  date="2003-12-08T16:28:43"
  subject="Re: [Caml-list] Object-oriented access bottleneck">
<msg 
  url="2003/12/b336119b9845b86570c36f5e200c22c7"
  from="Nuutti Kotivuori &lt;naked+caml@n...&gt;"
  author="Nuutti Kotivuori"
  date="2003-12-08T18:48:21"
  subject="Re: [Caml-list] Object-oriented access bottleneck">
</msg>
</msg>
</msg>
<msg 
  url="2003/12/794dd4e65d8ed369f6a8bf00a7fc3953"
  from="Nuutti Kotivuori &lt;naked+caml@n...&gt;"
  author="Nuutti Kotivuori"
  date="2003-12-08T10:18:02"
  subject="Re: [Caml-list] Object-oriented access bottleneck">
</msg>
<msg 
  url="2003/12/afbc265d71c1874f337802c94c8e954e"
  from="skaller &lt;skaller@o...&gt;"
  author="skaller"
  date="2003-12-08T20:51:58"
  subject="Re: [Caml-list] Object-oriented access bottleneck">
</msg>
</msg>
</msg>
</msg>
</msg>
</thread>

<contents>
 Nuutti Kotivuori [Tuesday 9 December 2003] :
 &gt;
 &gt; Nicolas Cannasse wrote:
 &gt; &gt; Obj.set_field (Obj.repr (Some 0)) 1000000 (Obj.repr ())
 &gt; &gt;
 &gt; &gt; But I'm quite surprise that's it's not inlined and slower than
 &gt; &gt; setting a record field (according to the bench results)... and even
 &gt; &gt; slower than calling method (???)
 &gt; 
 &gt; The implementation of Obj.set_field is:
 &gt; 
 &gt;   external set_field : t -&gt; int -&gt; t -&gt; unit = "%obj_set_field"
 &gt; 
 &gt; Where %obj_set_field is merely:
 &gt; 
 &gt;   Parraysetu Pgenarray;
 &gt; 
 &gt; from the primitives_table, which is pretty generic.
 &gt; 
 &gt; I am not sure why it isn't inlined either. It doesn't get inlined even
 &gt; when having the declaration in the same source file.

What are you talking about ? 
The Obj module and in particular Obj.set_field is about modifying caml
values (records, variants, tuples, whatever), not caml objects.

Access to instance variable in objects is not inlined because you
can't statically known in which slot is the variable. Ex:

  class foo = object val x = 0 end
  class bar = object val y = 1 inherit foo end

In an object foo, x is in slot 0, but in an object bar, x is in slot
1. (Actually that's not 0 and 1 but 2 and 3 because the object stores
other stuff in the first two slots).

-- 
   Olivier

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

</contents>

</message>

