Skip to content
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.

linux performance is not as good as windows #143

Open
qdztxc opened this issue Jan 20, 2022 · 4 comments
Open

linux performance is not as good as windows #143

qdztxc opened this issue Jan 20, 2022 · 4 comments

Comments

@qdztxc
Copy link

qdztxc commented Jan 20, 2022

I do benchmark with robin_hood, tsl, ska hashmaps, include insert/delete/find/not_find cases.
robin_hood is overally the best under windows platform (i7 11700k, win11). It's slightly faster than tsk and ska. The result is almost the same as https://martin.ankerl.com/2019/04/01/hashmap-benchmarks-04-04-result-RandomFindString/

But when I run the same benchmark under linux, robin_hood is two timers slower than tsl and ska. Both gcc and clang compiler with O3 optimization flag.
I glanced over robin_hood source code and didn't find any hint why it's slower under linux. Any idea about this?

Thanks and regards.

@qdztxc
Copy link
Author

qdztxc commented Jan 20, 2022

I tried windows platform + clang compiler. robin_hood performs as fast as MSVC.
The performance dropdown of linux seems casued by OS instead of compiler.

@Philippe91
Copy link

I have tried Windows/MSVC vs Apple/Clang on machines with similar processors, and Clang wins always (sometimes a lot).
Worth noting: ska hashmaps beat robin_hood almost always. I guess (?) thanks to the Fibonacci hashing which is being used (https://probablydance.com/2018/06/16/fibonacci-hashing-the-optimization-that-the-world-forgot-or-a-better-alternative-to-integer-modulo/)

@ktprime
Copy link

ktprime commented Feb 13, 2022

I tried windows platform + clang compiler. robin_hood performs as fast as MSVC. The performance dropdown of linux seems casued by OS instead of compiler.

you can try my bench https://github.com/ktprime/emhash/blob/master/bench/martin_bench.cpp
. the code is copy from martinus's git and the result is easy benched and comparison.
the result is also quite different martinus's result(depends on hash function + cpu + compiler + case).

@ktprime
Copy link

ktprime commented Feb 13, 2022

I have tried Windows/MSVC vs Apple/Clang on machines with similar processors, and Clang wins always (sometimes a lot). Worth noting: ska hashmaps beat robin_hood almost always. I guess (?) thanks to the Fibonacci hashing which is being used (https://probablydance.com/2018/06/16/fibonacci-hashing-the-optimization-that-the-world-forgot-or-a-better-alternative-to-integer-modulo/)

default load factor of ska hashmap is 0.5(same as tsl ::robin), so it's fast as you see.
I have benched many different third-party flat hash map/benchmark over 3 years(set same load factor). you can test and bench
https://github.com/ktprime/emhash/blob/master/bench/ebench.cpp.
(6 hash function, more than 10 hash maps, 16 key/value compoision, 3 compliers, 6 cpus, 3 os)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants