Improve release assets compression #1570
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Summary
Optimize release assets for file size, because the compress/decompress performance difference between these settings is negligible for our data.
At time of this commit, the total (release + debug) assets size before this patch is about 946 MB. After this patch, the total size is about 638 MB. So this change results in about 33% size (and download time) reduction for the release assets.
Compatibility
Users
Because the Windows file explorer GUI natively supports 7-Zip decompression since Windows 11 22H2 (released late 2022), this change should not affect the regular user experience for people with an up-to-date Windows machine. And since 7z is a fairly well-known format, I doubt it should cause confusion even for those whose OS doesn't have native extraction capability.
Steam release script
This is a breaking change for the Steam release script, because both the archive format (ZIP -> 7-Zip) and the file extension (
<filename>.zip-><filename>.7z) have changed. As such, this PR should not be merged before confirming compatibility with the Steam release script.The actual file name patterns aside from the file extension remain unchanged.
Alternatives considered
The asset format
Alternatively, we could've changed the ZIP algorithm used to LZMA, as support for it was added to the ZIP spec already in 2006, but as of this PR date, Windows file explorer still does not natively handle LZMA-compressed ZIP archives extraction. Therefore, to avoid users confusing LZMA-compressed ZIPs as being corrupted, I chose to instead change the entire archive format to 7-Zip (which is fully compatible for native .7z extraction with modern Windows 11).
Compressing intermediate build artifacts
I also experimented with changing the upload-artifact action's compression config between 1 (best speed) and 9 (best compression) from the default value of 6, but this made no meaningful difference in the CI job speeds (+/- a couple seconds, which could've been random load variance). So I decided to not change that from the default.
Toolchain
N/A
Linked Issues