-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: Double-Ended IndexMap #350
Comments
It's an interesting question!
The core is literally a Lines 27 to 33 in 15518f3
Right now, a If we simply changed the There are other parts of the If you decide to pursue this idea as a fork, I suggest starting from #343 where most of the Alternatively, hashlink is also based on |
I think you've nerd-sniped me, because I'm still thinking about this, and I may go ahead and try a fork based on |
At the moment I don't have any plans to go ahead with it, unless I run into hard performance issues with current setup - I'm mostly a user of HashMaps, never fiddled with implementing any, so it may be beyond my ability to complete it in reasonable time. Sorry for maybe exploring too broad. |
No worries! I think I will explore this, and I'll share it here if I do. |
Question to someone familiar with the codebase:
I am probably oversimplyfing things, but I imagine currently the IndexMap is backed by "something like a Vec", would changing it to "something like a VecDeque" allow popping first key-value pairs in O(1) time, same as popping last key-value pairs?
Basically my use case is that I could use a FIFO with random access by keys; as I understand currently IndexMap would allow for LIFO in O(1) time and FIFO in O(n) time.
How difficult do you think would be such modification of existing codebase?
The text was updated successfully, but these errors were encountered: