caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gerd Stolpmann <info@gerd-stolpmann.de>
To: skaller <skaller@users.sourceforge.net>
Cc: Markus Mottl <markus.mottl@gmail.com>,
	Hendrik Tews <H.Tews@cs.ru.nl>,
	caml-list@inria.fr
Subject: Re: [Caml-list] caml_oldify_local_roots takes 50% of the total runtime
Date: Thu, 26 Oct 2006 15:48:47 +0200	[thread overview]
Message-ID: <1161870528.20369.27.camel@localhost.localdomain> (raw)
In-Reply-To: <1161802911.12050.5.camel@rosella.wigram>

Am Donnerstag, den 26.10.2006, 05:01 +1000 schrieb skaller:
> On Wed, 2006-10-25 at 14:21 -0400, Markus Mottl wrote:
> 
> > It would be great if the GC could be improved in situations where
> > there are many local roots.  This is a pretty common problem when
> > interfacing non-trivial third party libraries, and the clumsy
> > workarounds require writing somewhat error-prone code. 
> 
> Just curious .. but why is there *ever* any need for more than
> one root? If you need to add a root, why not just add to
> an already rooted data structure? Would that solve the problem?
> 

Yes, that solves it. The point is that a normal data structure (e.g.
hash table, ...) can be moved to the major heap, so it is only traversed
for each major collection.

Note also that there are local and global roots. You need local roots
for every pointer that is _temporarily_ outside the heap, so yes, you
need usually a lot of them. Pointers on the stack are local roots, too.

Global roots are for pointers that are outside the heap for a long time.
I think these could be handled more efficiently by the GC, e.g. by
moving global roots to a second list when the object referenced by the
pointer is moved to the major heap.

Gerd
-- 
------------------------------------------------------------
Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany 
gerd@gerd-stolpmann.de          http://www.gerd-stolpmann.de
Phone: +49-6151-153855                  Fax: +49-6151-997714
------------------------------------------------------------


  parent reply	other threads:[~2006-10-26 13:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-25 15:49 Hendrik Tews
2006-10-25 18:21 ` [Caml-list] " Markus Mottl
2006-10-25 19:01   ` skaller
2006-10-26  9:50     ` Hendrik Tews
2006-10-26 13:48     ` Gerd Stolpmann [this message]
2006-10-27 11:36       ` Hendrik Tews
2006-10-27 13:17         ` Brian Hurt
2006-10-27 20:05           ` Robert Roessler
2006-10-27 21:16           ` Pierre Etchemaïté
2006-10-30  7:50           ` Hendrik Tews
2006-10-26  9:47   ` Hendrik Tews
2006-10-26 14:54     ` Markus Mottl
2006-12-15 10:56 ` Hendrik Tews

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1161870528.20369.27.camel@localhost.localdomain \
    --to=info@gerd-stolpmann.de \
    --cc=H.Tews@cs.ru.nl \
    --cc=caml-list@inria.fr \
    --cc=markus.mottl@gmail.com \
    --cc=skaller@users.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).