Skip to content

Commit

Permalink
perf: adjust compile flags for runtime performance (#314)
Browse files Browse the repository at this point in the history
* Tell rustc to target the CPU that it's running on; this brings the trade-off that compiled binaries may not be appropriate for execution on arbitrary target systems.
* Set lto setting to fat
* Configure panicking on abort (no unwinding)
  • Loading branch information
reubeno authored Jan 9, 2025
1 parent 379e1bf commit 28a1e63
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
[alias]
xtask = "run --package xtask --"

[build]
rustflags = ["-C", "target-cpu=native"]
13 changes: 10 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
[workspace]
resolver = "2"
members = ["brush-shell", "brush-parser", "brush-core", "brush-interactive", "fuzz", "xtask"]
members = [
"brush-shell",
"brush-parser",
"brush-core",
"brush-interactive",
"fuzz",
"xtask",
]
default-members = ["brush-shell"]

[workspace.package]
Expand Down Expand Up @@ -42,6 +49,6 @@ struct_excessive_bools = "allow"

[profile.release]
strip = "debuginfo"
opt-level = "z"
lto = true
lto = "fat"
codegen-units = 1
panic = "abort"

0 comments on commit 28a1e63

Please sign in to comment.