Skip to content

Unpack Leaf #229

Open
Open
@treeowl

Description

@treeowl

Currently,

data Leaf k v = L !k v
data HashMap k v
    = ...
    | Leaf !Hash !(Leaf k v)
    ...

We never change the hash without changing the key, and therefore also the Leaf value. So as far as I can tell, we only get a benefit from the indirection from HashMap to Leaf when a key-value pair moves between a Leaf node and a Collision node, which we assume is rare. The rest of the time, it's purely a waste of time and space. We should try using UNPACK and check that nothing regresses unexpectedly.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions