[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: MPS question: small object allocation
From: |
Gerd Möllmann |
Subject: |
Re: MPS question: small object allocation |
Date: |
Wed, 26 Jun 2024 17:20:58 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Daniel Colascione <dancol@dancol.org> writes:
> I'm catching up on the MPS branch. I'm super excited to see Emacs get a
> modern GC. (I regret that I never found time to finish my
> attempt from a few years ago.) It looks like MPS supports both manual
> memory management by pool and automatic garbage collection. Is there
> anything that might help us deal with the problem of having tons of
> small objects? In a traditional JVM-style GC, each object begins with a
> type-word of some sort (sometimes inflated for locking, etc.) This
> approach is inefficient for small objects: a cons cell, for example,
> would have 50% overhead, because it'd have to have one machine word for
> the type, then two machine words for car and cdr. Does MPS have a way
> to eliminate this per-object overhead for objects like cons cells,
> markers, and so on?
Hi Daniel,
MPS can support that, by allocating conses, as one example, from an MPS
pool that contains conses only. Igc doesn't do that ATM, all objects,
including conses, have the same 1 word header as other objects.
And it will be a ton of work to remove the header for some objects. Hash
tables for example: the igc_header also contains an address-independent
hash. When that is no longer the case for all objects, we need to
reimplement hash tables using an MPS feature that exists for that
purpose (location dependency).
And that's no fun at all, so it's something in search of an implementor
:-).