ruffle icon indicating copy to clipboard operation
ruffle copied to clipboard

chore: Reduce binary sizes in desktop releases

Open kjarosh opened this issue 10 months ago • 5 comments

Stripping symbols and enabling LTO makes the compiled artifacts smaller.

Desktop Linux shrinks from 40.4MB to 30.6MB.

  • Related to https://github.com/ruffle-rs/ruffle/issues/19687

kjarosh avatar Mar 06 '25 19:03 kjarosh

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

torokati44 avatar Mar 06 '25 19:03 torokati44

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 avatar Mar 06 '25 19:03 torokati44

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

torokati44 avatar Mar 06 '25 19:03 torokati44

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

https://github.com/ruffle-rs/ruffle/blob/383497e2bf0099b1ed264701fbccb859a6502e7f/web/packages/core/tools/build_wasm.ts#L6

adrian17 avatar Mar 06 '25 20:03 adrian17

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 avatar Mar 06 '25 20:03 kjarosh