-
-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows Installer Size and Speed Optimization #171
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@xyloflake Thanks for detailed description. |
It is specifically for muffon @staniel359 I did consider contributing directly to electron builder but I realised that they reset the compression config from literally anything to normal. Now I've only tested for Windows and have no idea about how it behaves on non-Windows platforms. But I ran a CI build that failed (linked in the PR description), which tells me that it has problems on other platforms, therefore I had to apply the patch only for windows. Also the reset is done with a goofy comment above it, which makes me doubt if they'd like to change. Moreover the v25 alphas are broken, I and @gamersi have tried building electron-builder from main but windows throws a fatal node-gyp error Once it becomes stable, I'll try to contribute directly to electron-builder although I am 90% sure they'll straight up reject the PR. But let's hope for the best I guess. For now, this is the solution to reducing Thanks. |
@xyloflake Got it. |
Overview
This pull request addresses optimizations to app-builder-lib, a pivotal component within the electron-builder monorepo.
Enhancements
Specifically tailored for version
24.13.3
of app-builder-lib, this patch introduces a novel custom compression level dubbedultra
. On platforms other than Windows,ultra
is internally set tomaximum
. Conversely, on Windows, a bespoke high-compression algorithm has been utilized to optimize the size efficiency of the NSIS target. This measure was necessitated by issues encountered on non-Windows platforms, as evidenced by the failed build.Electron builder internally resets the compression configuration option to
normal
for Windows, albeit without explicit rationale. Consequently, this patch intervenes to prevent the reset tonormal
exclusively for Windows systems, as the aforementioned algorithm cannot operate optimally on other platforms.Impact
The adoption of
maximum
compression forultra
on macOS and Linux results in increased build times across all platforms. On Windows, there's a notable build time surge owing to the necessity to compile internal libraries post-patch, utilizing Visual Studio.Overall, this enhancement culminates in a
7MB
reduction in size.However, it's important to note an 8% slowdown in installation speed, attributed to the heightened complexity of decompression.
Build Checks
For reference, the latest build checks can be viewed here.
Build Status: Passing ✅