fitzgen opened issue #11162:
Hashing is expensive and the fact that the bump chunk can fill and needs draining conflates "need GC" with "the bump chunk is full" and "the GC heap is at capacity".
Instead, we should:
- Add what is logically a
Option<VMGcRef>to the DRC's object header. This forms an intrusive singly-linked list that implements the over-approximation set, which is implemented with a hash set today, but this approach doesn't need any hashing or external allocations.- Replace the precise hash set with a mark bit in the object header. Again, no more hashing or external-to-the-gc-heap allocation or storage.
With that, DRC sweeping is still logically the same: walk over the over-approximation set, decref any object that is not in the precise set, and reset the over-approximation set to be the precise set. However, this will now be implemented as a mutable traversal of the over-approximation linked list.
This should result in a large speed up for test cases like #11141
fitzgen added the wasm-proposal:gc label to Issue #11162.
fitzgen added the performance label to Issue #11162.
fitzgen closed issue #11162:
Hashing is expensive and the fact that the bump chunk can fill and needs draining conflates "need GC" with "the bump chunk is full" and "the GC heap is at capacity".
Instead, we should:
- Add what is logically a
Option<VMGcRef>to the DRC's object header. This forms an intrusive singly-linked list that implements the over-approximation set, which is implemented with a hash set today, but this approach doesn't need any hashing or external allocations.- Replace the precise hash set with a mark bit in the object header. Again, no more hashing or external-to-the-gc-heap allocation or storage.
With that, DRC sweeping is still logically the same: walk over the over-approximation set, decref any object that is not in the precise set, and reset the over-approximation set to be the precise set. However, this will now be implemented as a mutable traversal of the over-approximation linked list.
This should result in a large speed up for test cases like #11141
Last updated: Dec 06 2025 at 06:05 UTC