3 ms·
The Bizarre Case of Zstd's Slow Performance on Arch Linux
- tzuyi728 4y agommm
- mcraiha 4y agoFor TL;DR, "having that C99 standard specified is what ultimately was found to cause this large performance difference"
- rurban 4y agoSo -std=c99 inserted by cmake was the culprit, whilst the default in current GCC is gnu17. So please people, don't use silly build systems. autoconf doesn't insert this sillyness, when the compiler does better. https://gcc.gnu.org/onlinedocs/gcc/Standards.html https://gcc.gnu.org/onlinedocs/gcc/Standards.html > The default, if no C language dialect options are given, is -std=gnu17.
- nemetroid 4y agoI’m sure autoconf will insert this if you explicitly tell it to [1]. 1: https://github.com/facebook/zstd/blob/b7b7edb3a3017ac8e16d7eb2dbede45168560c58/build/cmake/CMakeModules/AddZstdCompilationFlags.cmake#L28 https://github.com/facebook/zstd/blob/b7b7edb3a3017ac8e16d7e...
- jwilk 4y agozstd normally uses timespec_get() for measuring wall-clock time. But that's available only since C11. For older standards, it uses clock(); but that returns CPU time, which is wrong. https://github.com/facebook/zstd/pull/3165 https://github.com/facebook/zstd/pull/3165
- josephcsible 4y agoFollowing the GitHub issue, it seems like this is actually just a bug in the timing code, and that in actual use it's not any slower.