Optimize release build

by enabling lto, setting `codegen-units` to 1 and setting panic behavior
to `abort`.

On my `aarch64-apple-darwin` with `rustc 1.61.0`, this reduces the size
of binary from 7.8M to 4.9M

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-05-31 17:12:15 +10:00
parent f0e7fa0111
commit c989ed0823
No known key found for this signature in database
GPG key ID: 591C0B03040416D6

View file

@ -44,3 +44,8 @@ zip = "0.6.2"
[dev-dependencies]
env_logger = "0.9.0"
[profile.release]
lto = true
codegen-units = 1
panic = "abort"