Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I seem to recall that Clang consistently produces slower executable binaries than gcc does, although Clang compiles quicker. (The reason a lot of people use Clang for development but use gcc for the final production build)

Perhaps the assembly it's producing isn't quite as optimized as it could be if it were carefully hand crafted.



That may have been true in the past. All the data I've seen in the past few years has GCC generating faster code for some benchmarks, and clang generating faster code for others, with no really consistent pattern (this is by no means an exhaustive sample, but it is certainly large enough to be vaguely representative).

Interestingly (to me), I am seeing more and more examples where clang and gcc are beating icc in performance.


> Interestingly (to me), I am seeing more and more examples where clang and gcc are beating icc in performance.

Intel has finite resources (as much as Intel can realistically dedicate to the project), where-as both Clang and GCC projects have theoretically unlimited resources (as much as companies the world-over can dedicate to the project). Doesn't surprise me actually. Most say gcc version 4.7.1 overtook icc in performance by about 15% (and 4.7.1 is ancient now).




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: