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
[Caml-list] Object-oriented access bottleneck
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Nuutti Kotivuori <naked+caml@n...>
Subject: Re: [Caml-list] Object-oriented access bottleneck
Nicolas Cannasse wrote:
> Obj.set_field (Obj.repr (Some 0)) 1000000 (Obj.repr ())
> But I'm quite surprise that's it's not inlined and slower than
> setting a record field (according to the bench results)... and even
> slower than calling method (???)

The implementation of Obj.set_field is:

  external set_field : t -> int -> t -> unit = "%obj_set_field"

Where %obj_set_field is merely:

  Parraysetu Pgenarray;

from the primitives_table, which is pretty generic.

I am not sure why it isn't inlined either. It doesn't get inlined even
when having the declaration in the same source file.

-- Naked

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: