mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2026-03-04 00:01:12 -05:00
Improve binary size #3310
Labels
No labels
P1: Critical
P2: High
P3: Medium
P4: Low
UI
bug
cannot reproduce
compatibility
dependencies
docker
documentation
duplicate
enhancement
enhancement
external libs
feature request
good first issue
help wanted
infrastructure
invalid
localization
needs investigation
performance
potential-duplicate
question
recurrent
research
snap
waiting for data
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/AdGuardHome#3310
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ainar-g on GitHub (Dec 27, 2021).
Originally assigned to: @ainar-g on GitHub.
Discussed in https://github.com/AdguardTeam/AdGuardHome/discussions/4024
Originally posted by jamesmacwhite December 27, 2021
First of all, I just want to say AdGuard Home is great and it's really exciting to see all the constant development and features constantly being rolled out.
Once thing I've noticed is the binary size seems to be growing a fair bit. Comparing the last two latest stable releases 0.106.3 to 0.107.0 for ARMv7.
Roughly a 57% increase. Now for most contexts and platforms, this isn't really an issue. An increase of 13.7 MB in the context of today's world with data centres with literally petabytes of storage, it's nothing! However, for more embedded platforms such as routers which will have limited flash space, this is quite significant. There are of course ways to extend flash storage space with additional storage partitions and such, but it did make me think about the binary size itself.
With the great development cycle and constant releases and improvements is the binary size just going to continue to grow? I'm not really that familiar with Go so please forgive my ignorance. It is my understanding that because the binary is statically linked and includes the Go runtime, it will be much heavier, but it does raise the question whether at some point the binary size will make running on embedded products like routers very difficult.
Either way, just thought it was an interesting topic, thanks for anyone's contributions!
Thoughts
The two main suspects are the packed front-end and module
github.com/google/gopacket, which has some fairly large tables of some information. But perhaps there are others.@siavashs commented on GitHub (Dec 21, 2022):
I was able to compress the binary using
upx, in this case themipselbinary was compressed onamd64:The binary was shrunk from 36M to 11M!
I've tested the binary and it seems to be working fine so far, I recommend to compress the
betareleases using this method first and later do the same forstablereleases after proper testing.I'll report if I notice any issues with my setup using the compressed binary.
@tsl0922 commented on GitHub (Jun 27, 2023):
This is my patch to embed a zipped version of the static files to the binary.
The compiled binary size reduced from
28.25Mto20.69M(-26.76%, mipsle).