Skip to content

Generic type parameters to choose generation and index sizes #49

Description

@mikwielgus

Currently, both the generation and index types are u32. Hence, keys (indexes) are always 8 bytes.

In some applications, it may be beneficial to have smaller keys (indexes), e.g. u16 generation and u16 true index summing up to 4 bytes. This not only reduces used memory, but can also considerably improve iteration speed (since iteration is often memory-bound).

To make it possible to choose sizes, thunderdome::Arena could take generation and index types as generic parameters, e.g. thunderdome::Arena<G, I>, or even thunderdome::Arena<K: Key> and provide some default types that implement Key.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions