9 ms·
I agree that it is a better compiler, but have heard mixed results on whether it produces faster code. Do you have a citation?
by hendzen 9y ago
I agree that it is a better compiler, but have heard mixed results on whether it produces faster code. Do you have a citation?
- Ono-Sendai 9y agoI'm basing this assessment mostly on my own experience and testing. In terms of performance difference, it can be hard to compare since Clang-compiled programs often run on Linux, and MSVC programs run on Windows, so it's difficult to factor out the perf differences due to the OS. However I have measured one of our programs running significantly faster in a Linux VM, compiled in Clang, running with Windows as a host OS, than the program compiled with MSVC running directly on Windows. In addition, the analyses and optimisations performed by Clang are generally more sophisticated than by MSVC. See for example http://www.forwardscattering.org/post/51 http://www.forwardscattering.org/post/51. The only optimisation I know of that MSVC performs that Clang doesn't (in some cases at least) is autovectorisation of some maths functions: https://bugs.llvm.org/show_bug.cgi?id=23645 https://bugs.llvm.org/show_bug.cgi?id=23645 (Actually MSVC has a pretty effective link-time code gen option, that is often turned off by projects using Clang)