4 ms·
so, a helloworld program (`zig init`) is 9.3MB compiled. compared to `-Doptimize=ReleaseSmall` 7.6KB that is huge (more than 1000 times larger)
by treeshateorcs 1y ago
so, a helloworld program (`zig init`) is 9.3MB compiled. compared to `-Doptimize=ReleaseSmall` 7.6KB that is huge (more than 1000 times larger)
- AndyKelley 1y agoIndeed, good observation. Another observation is that 82% of that is debug info. -OReleaseSmall -fno-strip produces a 580K executable, while -ODebug -fstrip produces a 1.4M executable. zig's x86 backend makes for a significantly better debugging experience with this zig-aware lldb fork: https://github.com/ziglang/zig/wiki/LLDB-for-Zig https://github.com/ziglang/zig/wiki/LLDB-for-Zig I don't recall whether it supports stepping through comptime logic at the moment; that was something we discussed recently.
- 9d 1y ago[flagged]
- treeshateorcs 1y agois it naive to expect the new backend to release -OReleaseSmall binaries as small as llvm in the future?
- squeek502 1y agoAs far as I'm aware, using the self-hosted backend for anything other than Debug mode is a goal, but a far-future goal. I believe the most relevant links are https://github.com/ziglang/zig/issues/16270 https://github.com/ziglang/zig/issues/16270 and https://github.com/orgs/ziglang/projects/2/views/1?pane=issue&itemId=75955123 https://github.com/orgs/ziglang/projects/2/views/1?pane=issu... (as you can see, nothing is concrete yet, just vague mentions of optimization passes)