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

Making benchmarks better #4

Open
WaDelma opened this issue Oct 30, 2018 · 5 comments · May be fixed by #243
Open

Making benchmarks better #4

WaDelma opened this issue Oct 30, 2018 · 5 comments · May be fixed by #243

Comments

@WaDelma
Copy link

WaDelma commented Oct 30, 2018

The benchmarks should really be using criterion
It would be interesting to benchmark it against bytell-hash-map which I did rust implementation for (Haven't optimised it that much and should really make it usable library).

@WaDelma
Copy link
Author

WaDelma commented Oct 30, 2018

Also each benchmarked hashmap should be using the same hashing algorithm as otherwise you are comparing apples and oranges

@matthieu-m
Copy link

Current discussion on r/cpp about benchmark many hashmaps: https://www.reddit.com/r/cpp/comments/auwbmg/hashmap_benchmarks_what_should_i_add/

It may give ideas about new benchmarks and new hashmaps to consider.

Also, it's notable that Abseil's Swiss Table seem to struggle in benchmarks featuring insert/erase. In the benchmarks in the README we see hashbrown lagging 10% behind FxHashMap in grow_by_insertion, and otherwise always being faster, so it's unclear if hashbrown also suffers from this.

@Amanieu
Copy link
Member

Amanieu commented Feb 28, 2019

@matthieu-m Are the benchmark results available somewhere?

@matthieu-m
Copy link

Not that I know of, yet, short of running them yourself. At the moment the OP is gathering maps and benchmarks ideas, I am hoping that once everything is setup he'll publish some results.

@alkis
Copy link
Contributor

alkis commented Jun 26, 2019

For benchmarks you should replicate these. They are really good. They test:

  1. LookupHit
  2. LookupMiss
  3. Insert
  4. InsertErase (repeatedly insert and erase)
  5. Iteration
  6. Clear+InsertOrdered (ordered = same order as iteration order of the hashtable)
  7. Clear+InsertUnordered (unordered = random order)

The tests are parametrized to run across the cross product of these dimensions:

  1. payload sizes (4, 8, 16, 32, 64)
  2. hot and cold tables (hot=in cache, cold=not in cache)
  3. high and low density tables (high=max load factor, low=min load factor)

There is a good discussion in the forum about the design of these benchmarks and how they are useful. The most notable thing we found about benchmarks when implementing SwissTable is that benchmarks that predict production performance are very hard to write. In the end we wrote benchmarks to act as tools of understanding how a table behaves under certain loads and conditions: lookup/insert/miss, hot/cold, dense/sparse, etc. The only benchmarks we found useful for the hashtable as a whole was running large production workloads against them. In your case you have rustc-perf.

@henryboisdequin henryboisdequin linked a pull request Mar 1, 2021 that will close this issue
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 a pull request may close this issue.

4 participants