add missing deltas
This commit is contained in:
parent
19a412f05b
commit
ad8b48fbc3
|
@ -103,15 +103,15 @@ The resulting size was 1.1 MB, which should be easy enough to beat.
|
|||
The first thing that came to mind was telling the compiler to optimize for size, like with `gcc -Os`. The Rust equivalent is `opt-level = "s"`, and for even more optimization, `z` also disables loop vectorization.
|
||||
|
||||
| Option | size in isolation (change) | size cumulative (change) |
|
||||
| - | - | - |
|
||||
|-----------------------------------|----------------------------|--------------------------|
|
||||
| baseline | 1.137.384 | 1.137.384 |
|
||||
| opt-level = 'z' | 1.186.104 | 1.186.104 |
|
||||
| opt-level = 's' | 1.120.416 | 1.120.416 |
|
||||
| lto = true | 914.496 | 808.528 |
|
||||
| codegen-units = 1 | 982.904 | 775.888 |
|
||||
| panic = 'abort' | 979.840 |703.096|
|
||||
| strip = true | 915.944 | 580.056 |
|
||||
| switching back to opt-level = 'z' | | 555.480 |
|
||||
| opt-level = 'z' | 1.186.104 (+48.720) | 1.186.104 (+48.720) |
|
||||
| opt-level = 's' | 1.120.416 (-16.968) | 1.120.416 (-65.688) |
|
||||
| lto = true | 914.496 (-222.888) | 808.528 (-311.888) |
|
||||
| codegen-units = 1 | 982.904 (-154.480) | 775.888 (-32.640) |
|
||||
| panic = 'abort' | 979.840 (-157.544) | 703.096 (-72.792) |
|
||||
| strip = true | 915.944 (-221.440) | 580.056 (-123.040) |
|
||||
| switching back to opt-level = 'z' | | 555.480 (-24.576) |
|
||||
|
||||
So it turns out, if you want to halve your binary size, a few flags are enough in stable Rust.
|
||||
The most significant impacts came from link time optimization (LTO) and stripping of symbols from the binary.
|
||||
|
|
Loading…
Reference in a new issue