WerWolv / ImHex

🔍 A Hex Editor for Reverse Engineers, Programmers and people who value their retinas when working at 3 AM.
https://imhex.werwolv.net
GNU General Public License v2.0
39.53k stars 1.74k forks source link

[Hub] Artifact and cache size #1714

Open iTrooz opened 1 month ago

iTrooz commented 1 month ago

This issue is here to regroup all information about reducing the size of cache and artifacts

iTrooz commented 1 month ago

LTO seems to influence the ccache cache sizes a lot the ArchLinux ccache cache is 150MB with LTO, and 24MB without See https://gist.github.com/iTrooz/740f00f0935e365534f5a76dab0e7738 to measure section sizes for ELF

iTrooz commented 1 month ago

building in Release mode instead of RelWithDebInfo helps a lot with artifacts size. For example, Ubuntu 22.04 DEB went from 132MB to 16.2MB. Windows Installer went from 217MB to 24.2MB More information: https://github.com/iTrooz/ImHex/actions/runs/9231528139 and https://github.com/iTrooz/ImHex/actions/runs/9231536431

iTrooz commented 1 month ago

using -gz=zlib (or fallback on -gz doesn't seem to improve cache sizes (Checked on Ubuntu 22.04 and ArchLinux builds)

Artifacts sizes do not improve either. In fact, AppImage seems to have gone from 141MB to 162MB Windows and MacOS do not support this option.

Note that actual ELF files produced drastically reduce in size (e.g. 140.6MiB to 56.4MiB for libimhex for Ubuntu 22.04). The reason we are not observing changes in artifacts is because packages formats (e.g. .deb, .rpm, .tar.zst..) are already compressed.

NOTE: This means that this optimisation would still be useful once the package installed

More information: https://github.com/iTrooz/ImHex/actions/runs/9231528139 https://github.com/iTrooz/ImHex/actions/runs/9235290159