From: Andrea Corallo via "Emacs development discussions." <emacs-devel@gnu.org>
To: Daniel Colascione <dancol@dancol.org>
Cc: emacs-devel@gnu.org
Subject: Re: New GC concept
Date: Fri, 04 Jun 2021 08:56:43 +0000 [thread overview]
Message-ID: <xjfh7iehut0.fsf@sdf.org> (raw)
In-Reply-To: <bc4c03f1-5c6a-ab6c-acb1-4cee90a4b462@dancol.org> (Daniel Colascione's message of "Thu, 3 Jun 2021 20:30:26 -0700")
Daniel Colascione <dancol@dancol.org> writes:
> Emacs has had the same GC for a decent amount of time now (since the
> 1980s, really). I spent some time in 2020 rewriting it from scratch. I
> haven't had time to work on the new GC recently, but I figure I'd
> throw it out here to get some feedback on the general concept.
>
> Check out
> https://github.com/dcolascione/emacs-1/blob/newgc-wip/src/alloc.c,
> specifically the big doc comment on top
>
> The new GC basically replaces alloc.c and a few other things. It has a
> few cool features:
>
> * fully copying and compacting
>
> * special treatment of sxhash to preserve object identify even while
> we move it around in memory
>
> * generational
>
> * contiguous storage of mark bits separately from the data heap
>
> * concurrent (in design, not current implementation): idea is that we
> do concurrent marking and barely pause for sweep
>
> * small string optimization
>
> * bump pointer allocation of new objects
>
> * heap enumeration support
>
> * hard requirement on pdumper
>
> * specialized GC spaces for conses, strings, arrays, and so on: no
> stupid header word for cons cells bloating memory use by 50%!
>
> * cool modern C implementation that relies heavily on compiler
> inlining and constant propagation
>
> The current implementation is deficient in many ways. Honestly, I'm
> not even sure whether that specific revision compiles. But like I
> said, I haven't had time recently to continue work on it.
>
> Still, I'm still curious about what people think of the overall
> effort. It might work nicely with the new native compilation stuff,
> giving us a managed code execution environment kind-of, sort-of on par
> with the big modern managed-code runtimes.
Sounds cool!
The only comment I've so far is that IMO *the* important feature for a
new Emacs GC is to have it concurrent (or say concurrent as much as
possible).
Emacs user experience is often dictated by its reactivity, we need to
head towards a GC that is concurrent prioritizing in the design this
feature over others, I wouldn't mind sacrificing some efficiency for
that.
I like the idea of a moving/generational GC but possibily porting what
we have to a tri-color mark and sweep would solve already the problem
with less impact. This is what I would have tried if I had time.
Thanks for this work!
Andrea
next prev parent reply other threads:[~2021-06-04 8:56 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
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. [this message]
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=xjfh7iehut0.fsf@sdf.org \
--to=emacs-devel@gnu.org \
--cc=akrl@sdf.org \
--cc=dancol@dancol.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).