Skip to content

Remove hash sets and bump chunk from DRC collector #11162

@fitzgen

Description

@fitzgen

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    performancewasm-proposal:gcIssues with the implementation of the gc wasm proposal

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions