You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Newer versions of cargo allows symbols to automatically be stripped from the binary in release mode. Simply add the following to your Cargo.toml
[profile.release]
strip = true
This approximately halves the size of the binary on my computer, which makes it more attractive to ship CoverM e.g. as a dependency.
The downside is that stack traces will become useless. But I'm guessing the fraction of your users who know how to enable stack traces in Rust to debug an internal CoverM problem is miniscule. And among those who would know, they probably also know to just compile in debug mode if they want to debug. The quality of error messages on panics are unaffected, so since stack traces are disabled by default in Rust, the user should not see a difference.
You can also add lto = true under the [profile.release] section to enable link-time optimisation. This both improve binary size and might also improve performance (i.e .speed) of CoverM, but at the cost of longer compile times. However, on my laptop CoverM compiled in like 3 minutes in release mode with lto enabled, so it's probably worth it.
Both optimisations cut the binary size on my computer from 9.9M -> 4.7M
The text was updated successfully, but these errors were encountered:
Newer versions of
cargo
allows symbols to automatically be stripped from the binary in release mode. Simply add the following to yourCargo.toml
This approximately halves the size of the binary on my computer, which makes it more attractive to ship CoverM e.g. as a dependency.
The downside is that stack traces will become useless. But I'm guessing the fraction of your users who know how to enable stack traces in Rust to debug an internal CoverM problem is miniscule. And among those who would know, they probably also know to just compile in debug mode if they want to debug. The quality of error messages on panics are unaffected, so since stack traces are disabled by default in Rust, the user should not see a difference.
You can also add
lto = true
under the[profile.release]
section to enable link-time optimisation. This both improve binary size and might also improve performance (i.e .speed) of CoverM, but at the cost of longer compile times. However, on my laptop CoverM compiled in like 3 minutes in release mode withlto
enabled, so it's probably worth it.Both optimisations cut the binary size on my computer from 9.9M -> 4.7M
The text was updated successfully, but these errors were encountered: