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

Swap to boost::unordered_flat_map #95

Merged
merged 1 commit into from
Oct 17, 2024
Merged

Swap to boost::unordered_flat_map #95

merged 1 commit into from
Oct 17, 2024

Conversation

elliotgoodrich
Copy link
Owner

The performance of std::unordered_map is widely known to be sub-optimal due to the requirement for iterator and reference stability. This precludes

An up-to-date benchmark can be found here:
https://jacksonallan.github.io/c_cpp_hash_tables_benchmark, which shows that boost::unordered_flat_map performs extremely well for inserts and lookups, which is all we do. The lack of iteration speed, the erasure residual performance impact, and the minimum capacity of 30 all have no affect on us.

The boost::unordered_flat_map implementation has been taken from https://github.com/MikePopoloski/boost_unordered.

@elliotgoodrich elliotgoodrich force-pushed the boost_unordered branch 2 times, most recently from b1ecb4c to ccaa11c Compare October 17, 2024 04:37
The performance of `std::unordered_map` is widely known to be
sub-optimal due to the requirement for iterator and reference stability.
This precludes

An up-to-date benchmark can be found here:
https://jacksonallan.github.io/c_cpp_hash_tables_benchmark, which shows
that `boost::unordered_flat_map` performs extremely well for inserts and
lookups, which is all we do.  The lack of iteration speed, the erasure
residual performance impact, and the minimum capacity of 30 all have no
affect on us.

The `boost::unordered_flat_map` implementation has been taken from
https://github.com/MikePopoloski/boost_unordered.

Add more implementation to `fixed_string` as we now need to be
move-constructible and move-assignable since we will be moved around
inside `boost::unordered_flat_map`.

Add `SYSTEM` to the include path for `thirdparty` so we don't get
warnings on external code.
@elliotgoodrich
Copy link
Owner Author

Thanks @MikePopoloski for https://github.com/MikePopoloski/boost_unordered!

@elliotgoodrich elliotgoodrich merged commit b6482ca into main Oct 17, 2024
8 checks passed
@elliotgoodrich elliotgoodrich deleted the boost_unordered branch October 17, 2024 04:42
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.

1 participant