From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: "Daniel Colascione" <dancol@dancol.org>
Cc: emacs-devel@gnu.org
Subject: Re: pdumper's performance
Date: Tue, 04 Sep 2018 12:26:32 -0400 [thread overview]
Message-ID: <jwvzhwxjl9r.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <e3bd5661fe51fe827696aba4acc3a766.squirrel@dancol.org> (Daniel Colascione's message of "Wed, 29 Aug 2018 22:19:27 -0700")
> Dumping objects individually instead of in blocks both simplifies the
> implementation and allows for a more compact dump, as you point
> out below.
I understand the compactness argument, but I'm surprised it makes the
implementation simpler. I'll trust you on that, tho.
>> I naively thought your code would take
>> cons_blocks, symbol_blocks, ... and write those blocks as-is so objects
>> keep the same layout, and things like mark_maybe_object don't need to be
>> changed at all. I understand this would end up writing larger dumps
>> (since they would include some free objects), but I'd have expected it
>> would lead to simpler code and a smaller patch.
>
> If we keep the mark bits out of the objects, we can avoid modifying the
> object pages just for GC. In the non-PIC case, in which in principle we
> don't have to relocate the dump, that means that the pages in the dump
> stay clean and file-backed, not dirty, COWed, and pagefile-backed as they
> would if we banged on them just for the GC. That's an efficiency win.
I kind of see the benefit, but:
- unlike the purespace, the dumped&restored heap is not read-only,
so even with the markbits elsewhere the pages will generally not all
stay clean.
- the benefit you mention only applies to the case where
no-relocation was needed. And I suspect that in practice keeping those
pages "clean and file-backed" will very rarely make a noticeable
difference anyway.
- I like the idea of keeping markbits separately (XEmacs does the same,
IIUC, for the needs of their incremental GC where they want to mark
pages as read-only to catch writes from the mutator, while still
letting the collector twiddle the mark bits). But I think this should
be a separate patch and should apply to all objects rather than only
the pdump'd ones.
> For a future more-efficient GC, contiguous object storage with external
> mark bits is probably the way to go for the entire heap.
Agreed, obviously [ not only because of the text above, but also because
I implemented the separate markbits for floats and cons cells ;-) ]
Stefan
next prev parent reply other threads:[~2018-09-04 16:26 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-29 20:29 pdumper's performance Stefan Monnier
2018-08-29 22:10 ` Daniel Colascione
2018-08-30 2:14 ` Stefan Monnier
2018-08-30 5:19 ` Daniel Colascione
2018-09-04 16:26 ` Stefan Monnier [this message]
2018-09-04 16:42 ` Daniel Colascione
2018-09-04 19:30 ` Stefan Monnier
2018-09-04 19:35 ` Daniel Colascione
2018-09-04 20:58 ` Stefan Monnier
2018-09-04 21:20 ` Daniel Colascione
2018-09-04 21:49 ` Stefan Monnier
2018-09-04 21:33 ` Stefan Monnier
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=jwvzhwxjl9r.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=dancol@dancol.org \
--cc=emacs-devel@gnu.org \
/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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.