facebook / zstd

Zstandard - Fast real-time compression algorithm
http://www.zstd.net
Other
23.53k stars 2.09k forks source link

Significant compression speed diffs between Clang and GCC in long mode #2695

Open davidbolvansky opened 3 years ago

davidbolvansky commented 3 years ago

As noted in https://www.phoronix.com/scan.php?page=article&item=clang12-gcc11-icelake&num=2, there is a huge difference in compression speed between clang and gcc in long mode.

image

Standard mode looks kinda fine.

image

Missed vectorization? Any chance to improve it?

Cyan4973 commented 3 years ago

The code enabled by --long is likely better optimized by gcc than clang. clang improvements may happen in the future, but it's not a trivial issue. It would take a dedicated effort to alter the code in a way which would be friendlier to clang, assuming it's possible. And doing that without impacting negatively other compilers is hard to do. So we'll keep an eye on this topic, but not rush it.

danlark1 commented 3 years ago

I can try and help with that as I already tried in #2689 for decompression, yet, as @Cyan4973 said, it takes significant effort to make sure all compilers benefit from it, so no rushing