Closed waynr closed 10 months ago
well, for some reason I thought the LTO is enable by default for Rust release build. Looks it is indeed enabled in some "thin" mode if not specified. But I agree that "fat" LTO is good to have, I don't care if my compile time jumps from 20 to 40 seconds.
regarding the stripping, I didn't enable it since it makes analysis of crashdumps impossible, as the stack trace will lack function names. I don't know how valuable to know in Rust ecosystem what is the stack trace my program crashed with.
@waynr what do you think?
@waynr what do you think?
I think it's reasonable to produce both a small binary (with debug symbols) for target environments that require it and a large binary (without debug symbols) for target environments that can tolerate tolerate it. These can both be built as part of an automated release pipeline; something I neglected to suggest in #4 was some kind PR pipeline for validating changes as they come in (eg run tests, validate different rust toolchain builds and platform targets) and an on-merge pipeline that handles all the necessary build and release activities.
The new release profile options do the following:
strip = true
causes debug symbols to be stripped from the final binarycodegen-units = 1
reduces redundancies in codegen optimizations by forcing all code generation through a single unitlto = true
something something link-time optimizationFor me this took the binary size down from 7MB to roughly 682KB.