`<unordered_set>`, `<unordered_map>`: Optimize representation
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 11.1k
- Forks
- 1.7k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 22
Description
Currently unordered_ use doubly-linked lists and provide iterators that can be decremented.
It is sufficient to provide forward iterators and use single linked list. This will save some memory and help to address #1036 to some extent. Also it will address DevCom-10035118
From https://github.com/microsoft/STL/issues/1036#issuecomment-661742697:
unordered_meowreally shouldn't be backed by a doubly-linkedlist; it is required to be forward but not bidi, so it doesn't need sentinel nodes. We should be able to arrange its representation (including the bucket "map") to avoid allocating memory.
vNext note: Resolving this issue will require breaking binary compatibility. We won't be able to accept pull requests for this issue until the vNext branch is available. See #169 for more information.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the discussion linked from #1036 and the vNext context in #169, then confirm the compatibility constraints before attempting work. Done means revisiting the representation of unordered_set and unordered_map to use forward iteration and reduce memory, while accounting for the noted binary-compatibility break.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 20/100