Skip to content

chore: Reduce binary sizes in desktop releases #19727

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kjarosh
Copy link
Member

@kjarosh kjarosh commented Mar 6, 2025

Stripping symbols and enabling LTO makes the compiled artifacts smaller.

Desktop Linux shrinks from 40.4MB to 30.6MB.

@kjarosh kjarosh added A-build Area: Build scripts & CI T-chore Type: Chore (like updating a dependency, it's gotta be done) labels Mar 6, 2025
@kjarosh kjarosh marked this pull request as draft March 6, 2025 19:55
@torokati44
Copy link
Member

Don't we need them for stack traces in crash reports?

@torokati44
Copy link
Member

While on web, I can sort of see the point of trying to stay smaller, but on Desktop, and honestly, even in the browser extension, or on mobile, it should basically bear no weight IMHO, at least until we are not in the multi-hundred-MB territory (looks at electron apps).

@torokati44
Copy link
Member

If someone wants small: https://upx.github.io/

@adrian17
Copy link
Collaborator

adrian17 commented Mar 6, 2025

We also explicitly disabled stripping in wasm-opt to preserve symbols:

let args = ["-o", path, "-O", "-g", path];

@kjarosh
Copy link
Member Author

kjarosh commented Mar 6, 2025

Don't we need them for stack traces in crash reports?

I believe setting panic = "abort" makes us skip stack traces, and testing shows that we don't include them on desktop.

While on web, I can sort of see the point of trying to stay smaller, but on Desktop, and honestly, even in the browser extension, or on mobile, it should basically bear no weight IMHO, at least until we are not in the multi-hundred-MB territory (looks at electron apps).

I made this PR was to test whether web works with symbols stripped, because I kinda suspected it will break wasm bindgen (which apparently is true). According to my understanding we have no reason to have symbols on desktop release.

kjarosh added 2 commits March 6, 2025 21:40
Stripping symbols and enabling LTO makes the compiled artifacts smaller.
This reduces binary sizes in desktop releases.
@kjarosh kjarosh changed the title chore: Strip symbols in release mode chore: Reduce binary sizes in desktop releases Mar 6, 2025
@kjarosh kjarosh marked this pull request as ready for review March 6, 2025 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-build Area: Build scripts & CI T-chore Type: Chore (like updating a dependency, it's gotta be done)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants