Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Use unordered_dense for hash tables #2063

Open
ajtribick opened this issue Jan 13, 2024 · 2 comments
Open

Use unordered_dense for hash tables #2063

ajtribick opened this issue Jan 13, 2024 · 2 comments

Comments

@ajtribick
Copy link
Collaborator

The standard library unordered_map has various issues that make it slow. Might be worth investigating https://github.com/martinus/unordered_dense as a replacement.

(It may also be worth considering Boost flat_map for the case where we actually need a sorted map - e.g. for prefix searching in the name manager)

@375gnu
Copy link
Collaborator

375gnu commented Jan 13, 2024

We don't use unordered_map in any performance critical code afaik.

@ajtribick
Copy link
Collaborator Author

The other advantage of unordered_dense is that it offers the possibility for heterogeneous lookups (e.g. use a string_view to do lookups in a hash table with string keys), which isn't offered by std::unordered_map until C++20.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants