Strip release binaries to reduce download size #3763

Closed
opened 2025-11-02 05:24:28 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @ghost on GitHub (Aug 12, 2019).

Just running strip command on the binaries from https://dl.gitea.io/gitea/1.9.0/ reduces the compressed size of Gitea binaries for 64-bit Linux by 10 megabytes, which is almost 30% of the original size:

$ curl -sSf https://dl.gitea.io/gitea/1.9.0/gitea-1.9.0-linux-amd64.xz | xz -d > gitea-1.9.0-linux-amd64
$ xz -k -9 < gitea-1.9.0-linux-amd64 | wc -c
35780080
$ strip gitea-1.9.0-linux-amd64 
$ xz -k -9 < gitea-1.9.0-linux-amd64 | wc -c
25514852

So it might be a good idea to add stripping for the binaries as a build step in CI release script for all platforms that support it.

Originally created by @ghost on GitHub (Aug 12, 2019). Just running [`strip`](https://en.wikipedia.org/wiki/Strip_(Unix)) command on the binaries from https://dl.gitea.io/gitea/1.9.0/ reduces the compressed size of Gitea binaries for 64-bit Linux by 10 megabytes, which is almost 30% of the original size: ``` $ curl -sSf https://dl.gitea.io/gitea/1.9.0/gitea-1.9.0-linux-amd64.xz | xz -d > gitea-1.9.0-linux-amd64 $ xz -k -9 < gitea-1.9.0-linux-amd64 | wc -c 35780080 $ strip gitea-1.9.0-linux-amd64 $ xz -k -9 < gitea-1.9.0-linux-amd64 | wc -c 25514852 ``` So it might be a good idea to add stripping for the binaries as a build step in CI release script for all platforms that support it.
GiteaMirror added the type/proposal label 2025-11-02 05:24:28 -06:00
Author
Owner

@silverwind commented on GitHub (Aug 13, 2019):

Relevant: https://blog.filippo.io/shrink-your-go-binaries-with-this-one-weird-trick/

@silverwind commented on GitHub (Aug 13, 2019): Relevant: https://blog.filippo.io/shrink-your-go-binaries-with-this-one-weird-trick/
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#3763