optimize release binary

This commit is contained in:
Aron Heinecke 2021-08-13 15:40:10 +02:00
parent 13e05c033b
commit 705e5d6c26
3 changed files with 9 additions and 0 deletions

2
.cargo/config.toml Normal file
View file

@ -0,0 +1,2 @@
[build]
rustflags = ["-C", "target-cpu=native"]

View file

@ -6,6 +6,9 @@ edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[profile.release]
lto = true
[dependencies]
toml = "0.5"
serde = { version = "1.0", features = ["derive"] }

View file

@ -11,6 +11,10 @@ Then run `cargo build --release`
.exe/elf is inside target/release/
You can also run `cargo run --release` instead to directly build & execute the resulting binary.
### Build optimization
The default release build is heavily optimized, using native target-cpu instructions and LTO. You can disable LTO in the Cargo.toml under `[profile.release]`, which can reduce the build time by a lot. And you can disable the target-cpu flags in `.cargo/config.toml`.
## Starting
Setup your credentials inside .credentials.toml by copying credentials.example.toml