unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Daniel Mendler <mail@daniel-mendler.de>
To: Daniel Colascione <dancol@dancol.org>, emacs-devel@gnu.org
Subject: Re: New GC concept
Date: Fri, 4 Jun 2021 10:00:05 +0200	[thread overview]
Message-ID: <1658db95-d513-7f21-8751-0e2ea38946cb@daniel-mendler.de> (raw)
In-Reply-To: <bc4c03f1-5c6a-ab6c-acb1-4cee90a4b462@dancol.org>

Interesting, thank you for working on this!

I had hoped that a new GC would surface at some point given the recent
improvements regarding native compilation. As you say this can bring
Emacs on par with modern managed language runtimes. Can you elaborate a
bit more of some of your concepts?

> * fully copying and compacting

How do you ensure that compaction works together with the conservative
stack scanning? You pin memory blocks, which are potentially referenced
by the stack?

> * generational

Do you rely on the OS memory protection as a write barrier to separate
the different generations, similar to how the bdwgc does that?

> * specialized GC spaces for conses, strings, arrays, and so on: no
stupid header word for cons cells bloating memory use by 50%!

Avoiding the headers is a good idea. You are using a first fit strategy
to find the next free space for a new object. How do you use the
headerless approach for objects of different sizes? Isn't it the case
that every block should then contain objects of only a single type and
of a single size? Probably most of the objects fall in a few size
classes, so it may be possible to do better than first fit?

Overall is your design similar to the approach of the bdwgc plus that a
memory/object layout tailored to the needs of Emacs and the compaction?
How well does such a GC hold up to a GC which is precise and does not
rely on the OS facilities for barriers? It appears such a precise GC is
impossible to retrofit on the existing Elisp runtime, so I assume your
approach is the right way to go.

Daniel Mendler



  reply	other threads:[~2021-06-04  8:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-04  3:30 New GC concept Daniel Colascione
2021-06-04  8:00 ` Daniel Mendler [this message]
2021-06-04  9:47   ` Daniel Colascione
2021-06-04 10:50     ` Eli Zaretskii
2021-06-21 13:00       ` Fejfighter
2021-06-21 13:31         ` Eli Zaretskii
2021-06-21 22:43         ` Daniel Colascione
2021-07-24 13:39           ` Fejfighter
2021-06-04 11:06     ` Daniel Mendler
2021-06-04  8:56 ` Andrea Corallo via Emacs development discussions.
2021-06-07 17:32 ` Matt Armstrong
2021-06-07 18:03   ` Daniel Colascione
2021-06-07 19:51     ` Daniele Nicolodi
2021-06-08  2:22       ` Eli Zaretskii
2021-06-21 22:58         ` Daniel Colascione
2021-06-22 12:59           ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=1658db95-d513-7f21-8751-0e2ea38946cb@daniel-mendler.de \
    --to=mail@daniel-mendler.de \
    --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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).