From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id E276BBBAF for ; Sat, 30 Oct 2010 22:40:20 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhcBAAgfzExKfVK2kGdsb2JhbACTHTGBIoxSCBUBAQEBCQkMBxEDH6I6i3EBBY5KAQSDAwiCOQ X-IronPort-AV: E=Sophos;i="4.58,265,1286143200"; d="scan'208";a="85793122" Received: from mail-wy0-f182.google.com ([74.125.82.182]) by mail1-smtp-roc.national.inria.fr with ESMTP; 30 Oct 2010 22:40:18 +0200 Received: by mail-wy0-f182.google.com with SMTP id 42so4330598wyb.27 for ; Sat, 30 Oct 2010 13:40:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:from:to:references :in-reply-to:subject:date:organization:message-id:mime-version :content-type:content-transfer-encoding:x-mailer:thread-index :content-language; bh=Rv/RpGUAMPsTR8iwv0+eP9XvfegYxyrh1iFA8aI976g=; b=pNUF7i5ufsq7wp3jrr2z/u4wUB70vPX6h/6ZFPQG7DPLkUE1oyinF66sDg4mNsupfx Jy5yxoIKzZS3GP5FTBUzLSIOyKPf7uYX8uo9MXfkecOgl4dQJHUzdrKaaC0MhzgeaiM/ O9LO+tenq8ZpK6RZ/faz08Mlu2eRxIbAFJvys= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=from:to:references:in-reply-to:subject:date:organization:message-id :mime-version:content-type:content-transfer-encoding:x-mailer :thread-index:content-language; b=oD1L+8AypeRFnA85iJQ7HxKLHewVgKzbgEUzuO6z0HZ51yPxDPG2fJzIgKjqhmIvnM g524k55coW7lf/Y77jIk9we7JMd6B7z7+ur8DeXAqH1dWgU5dNMD1v7s0m+oG9hAvFr/ 6zVitsGndt21KmIDL3xXoKJeYjmGbiXJKSfWA= Received: by 10.227.147.129 with SMTP id l1mr13825428wbv.55.1288471217091; Sat, 30 Oct 2010 13:40:17 -0700 (PDT) Received: from WinEight ([87.112.186.137]) by mx.google.com with ESMTPS id i19sm3458160wbe.17.2010.10.30.13.40.14 (version=SSLv3 cipher=RC4-MD5); Sat, 30 Oct 2010 13:40:16 -0700 (PDT) From: Jon Harrop To: References: <418632253.26199.1288302511712.JavaMail.root@zmbs1.inria.fr> <8277D889-83E2-4037-91B3-3EB5E9EB2EA9@inria.fr> In-Reply-To: Subject: RE: [Caml-list] How does OCaml update references when values are moved by the GC? Date: Sat, 30 Oct 2010 21:40:07 +0100 Organization: Flying Frog Consultancy Message-ID: <019401cb7872$a607b940$f2172bc0$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Act3PavYsjUfA3x6RLCODGfu833R6ABE5aswAAIb65A= Content-Language: en-gb X-Spam: no; 0.00; ocaml:01 ocaml's:01 ocaml:01 pointers:01 pointers:01 compaction:01 run-time:01 traversing:01 rewriting:01 hash:01 cheers:01 damien:01 damien:01 beginner's:01 bug:01 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