Skip to content

Explore replacing BTreeSet in IndexedMap with a sorted Vec #1473

Closed
@TheBlueMatt

Description

@TheBlueMatt

We currently use a BTreeMap for storing network graph data, as we need to be able to access it starting from a given key and continue iteration. This makes a sorted KV store like a BTree the obvious choice, but we don't actually need the keys to be sorted, we just need them to not change order as we iterate the graph.

Technically we also need to be able to check if a new key is below some previous iteration that is in-progress.

Supposedly the indexmap crate may offer something like what we need, but ultimately any hashtable that doesn't ever re-hash should suffice, and while creating our own probably won't be as efficient as hashbrown, it'd probably still be faster than a btree, and use way less memory compared to the substantial heap fragmentation that a btree creates.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions