logoalt Hacker News

bjournetoday at 8:48 AM2 repliesview on HN

Zig is not faster than C.


Replies

flohofwoetoday at 11:10 AM

With default build settings it actually might be, because Zig's release mode builds with the equivalent of `-march=native` by default ;)

(disclaimer: not sure if that's actually still the case, last I checked in detail was probably 2 years ago).

Also Zig always builds the entire project as a single compilation unit, which allows more optimization options because the compiler sees all function bodies. The closest equivalent in the C world is LTO, but this is usually also not enabled by default.

lionkortoday at 11:05 AM

Would you say its always slower, or always faster?

show 2 replies