Open chenyan-dfinity opened 1 year ago
With the current rustc setup, the best Rust release profile for canister seems to be:
rustc
[profile.release] lto = true opt-level = 2
Observations:
LTO = true
LTO = 'thin'
opt-level = 'z'
opt-level = 3
opt-level = 2
With the current
rustc
setup, the best Rust release profile for canister seems to be:Observations:
LTO = true
reduces both binary size and cycle cost (#63)LTO = true
toLTO = 'thin'
increases both binary size and cycle cost (#64, #65)opt-level = 'z'
reduces binary size by 20%+ with cycle cost also increased by 20%+ (#61)opt-level = 3
toopt-level = 2
reduces binary size by 5%+ with negligible cycle cost change (#62)