logoalt Hacker News

lionkortoday at 11:05 AM2 repliesview on HN

Would you say its always slower, or always faster?


Replies

flohofwoetoday at 11:12 AM

The optimization work happens in the LLVM backend, so in most cases (and using the same optimization and target settings - which is an important detail, because by default Zig uses more aggressive optimization options than Clang), similar Zig and C code translates to the exact same machine code (when using Clang to build the C code).

The same should be true for any compiled language sitting on top of LLVM btw, not just C vs Zig.

bjournetoday at 2:22 PM

No. I will continue my crusade against blanket statements about performance.