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

Dubious lookup benchmark for unordered sets #54

Open
cookiestarfish opened this issue Feb 16, 2024 · 1 comment
Open

Dubious lookup benchmark for unordered sets #54

cookiestarfish opened this issue Feb 16, 2024 · 1 comment

Comments

@cookiestarfish
Copy link

The benchmark report shows ~20ns average lookup time for std::unordered_set, which is less than the time taken by a cache miss, therefore unrealistic for average sized sets. The benchmark uses sets of 100k elements, a std::unordered_set of 100k int32 barely fits in L3 cache and the benchmark makes it look too good in comparison with amc::FlatSet.
I suggest to use bigger set sizes, or repeat the benchmark for different set sizes.

@sjanel
Copy link
Member

sjanel commented Feb 17, 2024

Hello, thanks for your input!

Actually the comparison with std::unordered_set is supposed to be unfair against FlatSet for lookup operations as it has constant lookup complexity in average. But it's true that benchmarks could be provided for different set sizes. I will add it in my todo list!

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

No branches or pull requests

2 participants