4 ms·
Is there any logical reason why Clang is 50% slower than GCC on Ubuntu?
by fransje26 3y ago
Is there any logical reason why Clang is 50% slower than GCC on Ubuntu?
- ijan1 3y agoHi, I had a look today because it was bugging me and no one had investigated it, so I created an issue[1] with an explanation. But it basically boils down to uniform_real_distribution having a bunch of uninlined calls to 'logl' when compiled with Clang. Otherwise, Clang beats GCC at least on the configuration I tested. (I am the author of the issue) [1] https://gitlab.com/define-private-public/PSRayTracing/-/issues/85 https://gitlab.com/define-private-public/PSRayTracing/-/issu...
- fransje26 3y agoOh, very nice find! Coincidentally, I happened to be playing around yesterday with a small performance test case using uniform_real_distribution, and for some strange reason Clang was 6x slower than GCC. I put it down to some weird clang bug on my LTS version of Ubuntu. As my installed version was clang-14, I decided it possibly had been noticed and fixed a long time ago. After reading your message I replaced uniform_real_distribution by uniform_int_distribution, and lo and behold, Clang was indeed faster than GCC, as expected. Thank you for coming back to me with your findings.