Skip to content

Conversation

@chrysn
Copy link
Contributor

@chrysn chrysn commented May 19, 2020

Based on #11, this is adding a SlotMap implentation.

It is built for the embedded use case (where the number of slots can be counted with a few bits), and packs the generation in the high bits of the key (so access should be a plain mask, get, compare).

I'm not happy yet with the performance -- manipulation is a lot slower than to the plain RawSlots, and I couldn't yet figure out why.

@chrysn chrysn marked this pull request as draft May 19, 2020 16:08
@chrysn
Copy link
Contributor Author

chrysn commented May 19, 2020

(Plus this will need some changes to account for the last weeks; I had forgotten to push this right away).

@bugadani
Copy link
Owner

Thanks for your continued interest in this project :)

Before progressing forward on this front, I think we should first stabilize the split-up unrestricted and "normal" structures (I've redone #11 on top of the latest changes, I'll add iter_mut() and clean up the implementation before merging).

For SlotMap I think there is no reason to try to be clever instead of storing the generation in a different word than the index itself. I'd personally take the performance over some extra bytes of memory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants