English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 2003-12-09 (12:10)
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 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