Skip to content
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

Hash data structure(s) design document #9

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
There are several “hash map” like data structures lie on a spectrum from high-performance, bare metal with restricted features to more convenient,
full-featured structures that may be less performant.
cuCollections will likely have several classes that are on different points on this spectrum.


| Tentative Name | Summary | Priority | Est. Release | Size | Supported Key Types | Supported Value Types | Duplicate Keys? | Sentinel Values? | Insert | Find | Concurrent <br>Insert/Find? | Erase | Concurrent <br>Insert/Find/Erase? | Bulk Insert | Bulk Find |
|:--------------------------:|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:--------:|:------------:|:--------:|:-------------------:|:---------------------:|:---------------:|:----------------:|:------:|:----:|:---------------------------:|:-----------------------------------:|:---------------------------------:|:-----------:|:---------:|
| `static_map` | A fixed-size, open addressing hash map using linear probing. <br>Requires reserving sentinel key/values for empty slots.<br>Supports insert/find (not concurrent). Does not support erase. | P0 | Aug 2020 | Static | Arithmetic | Trivially Copyable | No | Yes. Key & Value | Yes | Yes | No | No | N/A | Yes | Yes |
| `chained_map` | A hash map that can grow by chaining together multiple `static_map`<br>submaps. Requires reserving sentinel key/values for empty slots.<br>Growth happens automatically in bulk insert operations, or<br>can be done manually by user. | P0 | Aug 2020 | Dynamic | Arithmetic | Trivially Copyable | No | Yes. Key & Value | Yes | Yes | No | No | N/A | Yes | Yes |
| `static_multimap` | A fixed-size, open addressing hash multimap using linear probing. <br>Supports insert/find (not concurrent). Does not support erase.<br>Requires reserving sentinel key/values for empty slots. | P1 | ? | Static | Arithmetic | Trivially Copyable | Yes | Yes. Key & Value | Yes | Yes | No | No | N/A | Yes | Yes |
| `chained_multimap` | A hash multimap that can grow by chaining together multiple `static_multimap`<br>submaps. Growth happens automatically in bulk insert operations, or<br>can be done manually by user. Requires reserving sentinel key/values for empty slots. | P1 | ? | Dynamic | Arithmetic | Trivially Copyable | Yes | Yes. Key & Value | Yes | Yes | No | No | N/A | Yes | Yes |
| `general_static_map` | A fixed-size, open addressing hash map using linear probing. <br>Uses an additional array of status bits instead of sentinels for empty slots.<br>Tentatively supports concurrent insert/find/erase. | P2 | ? | Static | Trivially Copyable? | Trivially Copyable? | No | No | Yes | Yes | Yes | Yes, but slot <br>cannot be reused. | Yes | Yes | Yes |
| `general_chained_map` | A hash map that can grow by chaining together multiple `general_static_map`<br>submaps. Growth happens automatically in bulk insert operations, or<br>can be done manually by user. Uses status bits instead of sentinel values. | P2 | ? | Dynamic | Trivially Copyable? | Trivially Copyable? | No | No | Yes | Yes | Yes | Yes, but slot <br>cannot be reused. | Yes | Yes | Yes |
| `general_static_multimap` | A fixed-size, open addressing hash multimap using linear probing. <br>Uses an additional array of status bits instead of sentinels for empty slots.<br>Tentatively supports concurrent insert/find/erase. | P2 | ? | Static | Trivially Copyable? | Trivially Copyable? | Yes | No | Yes | Yes | Yes | Yes, but slot <br>cannot be reused. | Yes | Yes | Yes |
| `general_chained_multimap` | A hash multimap that can grow by chaining together multiple `general_static_multimap`<br>submaps. Growth happens automatically in bulk insert operations, or<br>can be done manually by user. Uses status bits instead of sentinel values. | P2 | ? | Dynamic | Trivially Copyable? | Trivially Copyable? | Yes | No | Yes | Yes | Yes | Yes, but slot <br>cannot be reused. | Yes | Yes | Yes |