News for hackers. Stuff that matters.
Re:Low-Level Optimization with Zig by haberman on Saturday June 07, 2025 @05:56PM (#44212962)
I agree with almost all of this, including the point about c header files, except that code has to be in headers to be inlined (unless you use LTO), which in practice forces code into headers even if you’d prefer to keep it private.
Re:Low-Level Optimization with Zig by keldaris on Saturday June 07, 2025 @07:52PM (#44213487)
There's nothing wrong with using LTO, but I prefer simply compiling everything as a single translation unit ("unity builds"), which gets you all of the LTO benefits for free (in the sense that you still get fast compile times too).