Comment

Comment by MaxBarraclough

> That's a big gap

I wouldn't say so. The gap between GCC and Clang/LLVM is bigger than that on some benchmarks, [0] although the gap between their overall performance (using geometric mean) is much less. [1]

It's a very impressive result considering how much effort has gone into GCC. It highlights how compiler optimisation work can face diminishing returns.

> the norm for releases being O2 if I understand correctly

Agreed, but the difference isn't that great. From the article:

> CompCert code is 7% slower than gcc-01 and 12% slower than gcc-02 on average.

Reminds me of how the cproc/qbe C compiler gets very roughly 50% of the performance of Clang/LLVM in 0.1% the lines-of-code. [2]

[0] https://www.phoronix.com/review/gcc-16-vs-clang-22/3

[1] https://www.phoronix.com/review/gcc-16-vs-clang-22/6

[2] https://drewdevault.com/talks/qbe/ (and see the linked slideshow PDF, as the abstract is a little misleading)

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton