-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
crc32c benchmark is 2X faster for gcc builds vs clang #9891
Comments
Results for all of the CPU-intensive microbenchmarks from db_bench All numbers are MB/s
|
CC: @Cyan4973 |
Bug filed for llvm |
Since it is not a RocksDB issue and llvm already made changes to fix it, should we close it? |
Probably worth verifying the LLVM fix in next release |
I don't mind owning it until a fix arrives in a clang release that we use. AFAIK the fix was pushed upstream recently. |
fixed in upstream clang |
Expected behavior
I expect similar performance for this whether gcc or clang was used:
db_bench --benchmarks=crc32c
Actual behavior
Results for gcc builds are more than 2X faster than clang builds.
Steps to reproduce the behavior
Using: Ubuntu 20.04, gcc 9.4.0 and clang 10.0.0-4ubuntu1
Create 3 binaries:
Then run ./db_bench --benchmarks=crc32c
On an Intel NUC I have at home (see here) the results are 19317 MB/s for gcc vs ~8900 MB/s for the clang builds. I can also repeat this on larger servers but won't share the details here.
A diff of the compiler command lines for gcc vs clang.0
And a diff for gcc vs clang.1
Compiler command lines for the crc32 code and note that -march=native -DHAVE_SSE42 -DHAVE_PCLMUL -DHAVE_AVX2 are used in all:
The text was updated successfully, but these errors were encountered: