optimize release binary
This commit is contained in:
parent
13e05c033b
commit
705e5d6c26
3 changed files with 9 additions and 0 deletions
2
.cargo/config.toml
Normal file
2
.cargo/config.toml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
[build]
|
||||||
|
rustflags = ["-C", "target-cpu=native"]
|
|
@ -6,6 +6,9 @@ edition = "2018"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
[profile.release]
|
||||||
|
lto = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
toml = "0.5"
|
toml = "0.5"
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
|
|
|
@ -11,6 +11,10 @@ Then run `cargo build --release`
|
||||||
.exe/elf is inside target/release/
|
.exe/elf is inside target/release/
|
||||||
You can also run `cargo run --release` instead to directly build & execute the resulting binary.
|
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
|
## Starting
|
||||||
Setup your credentials inside .credentials.toml by copying credentials.example.toml
|
Setup your credentials inside .credentials.toml by copying credentials.example.toml
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue