Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re: [Caml-list] How does OCaml update references when values are moved by the GC?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jon Harrop <jonathandeanharrop@g...>
Subject: RE: [Caml-list] How does OCaml update references when values are moved by the GC?
I just found some interesting statements made by others on this post about
optimizing OCaml's write barrier:

  http://eigenclass.org/R2/writings/optimizing-caml_modify

In the comments, Mauricio said that caml_modify (the write barrier)
accounted for over 30% of the total running time of the whole application.

> -----Original Message-----
> From: Jon Harrop [mailto:jon@ffconsultancy.com]
> Sent: 30 October 2010 18:16
> To: 'Damien Doligez'; 'caml-list@inria.fr'
> Subject: RE: [Caml-list] How does OCaml update references when values
> are moved by the GC?
> 
> I was hoping for a little more detail, of course. :-)
> 
> How is the mapping from old to new pointers stored? Does the GC rewrite
> all of the thread-local stacks in series before allowing any of them to
> continue? Does the write barrier record pointers written into the major
> heap so only those specific locations are rewritten at minor heap
> collections but the entire major heap is rewritten upon compaction? Can
> the GC distinguish between an array of ints and an array of pointers at
> run-time in order to avoid traversing all of the ints when trying to
> rewrite pointers?
> 
> Also, any idea what the maximum proportion of the running time of a
> program is spent doing this rewriting? For example, if you fill a
> float->float hash table with values does updating the pointers in the
> major heap account for a significant proportion of the total running
> time of the program?
> 
> Cheers,
> Jon.
> 
> > -----Original Message-----
> > From: caml-list-bounces@yquem.inria.fr [mailto:caml-list-
> > bounces@yquem.inria.fr] On Behalf Of Damien Doligez
> > Sent: 29 October 2010 08:48
> > To: caml users
> > Subject: Re: [Caml-list] How does OCaml update references when values
> > are moved by the GC?
> >
> >
> > On 2010-10-28, at 23:48, Jon Harrop wrote:
> >
> > > How does OCaml update references in the stacks and heap when values
> > are
> > > moved by the GC?
> >
> >
> > They are updated by the GC, of course.
> >
> > -- Damien
> >
> > _______________________________________________
> > Caml-list mailing list. Subscription management:
> > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> > Archives: http://caml.inria.fr
> > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> > Bug reports: http://caml.inria.fr/bin/caml-bugs