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.
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.
u16generation andu16true 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::Arenacould take generation and index types as generic parameters, e.g.thunderdome::Arena<G, I>, or eventhunderdome::Arena<K: Key>and provide some default types that implementKey.