Skip to content

Commit

Permalink
Enable some optimization flags (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
dani-garcia authored Jun 27, 2023
1 parent 237d517 commit a996478
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
[workspace]

members = ["crates/*"]

# Compile all dependencies with some optimizations when building this crate on debug
# This slows down clean builds by about 50%, but the resulting binaries can be orders of magnitude faster
# As clean builds won't occur very often, this won't slow down the development process
[profile.dev.package."*"]
opt-level = 2

# Turn on a small amount of optimisation in development mode. This might interfere when trying to use a debugger
# if the compiler decides to optimize some code away, if that's the case, it can be set to 0 or commented out
[profile.dev]
opt-level = 1

# Turn on LTO on release mode
[profile.release]
lto = "thin"
codegen-units = 1
# Stripping the binary reduces the size by ~30%, but the stacktraces won't be usable anymore.
# This is fine as long as we don't have any unhandled panics, but let's keep it disabled for now
# strip = true

0 comments on commit a996478

Please sign in to comment.