Skip to content

Instantly share code, notes, and snippets.

@danmack
Created November 26, 2023 21:42
Show Gist options
  • Save danmack/8dc969d8864dd6a70c155f8aae73d3b0 to your computer and use it in GitHub Desktop.
Save danmack/8dc969d8864dd6a70c155f8aae73d3b0 to your computer and use it in GitHub Desktop.
ziglang binary sizes by compiler option test

Zig Binary Sizes by Compiler Option

Testing binary sizes created by zig on an alpine linux using zig built from its master branch.

$ ls -l release* | sort -n -k4 | awk '{ printf("%21s %8d bytes\n", $NF, $5);}'
        releaseSmall    13696 bytes
releaseFast-stripped   186496 bytes
releaseSafe-stripped   224096 bytes
         releaseFast  1835368 bytes
         releaseSafe  1911648 bytes
        releaseDebug  2037144 bytes

releaseSmall is automatically stripped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment