Skip to content

Commit b264e60

Browse files
committed
Enable fat LTO
1 parent 9090aea commit b264e60

File tree

2 files changed

+28
-14
lines changed

2 files changed

+28
-14
lines changed

Cargo.lock

Lines changed: 3 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ regex-automata = { version = "0.4.9" }
146146
rustc-hash = { version = "2.0.0" }
147147
rustc-stable-hash = { version = "0.1.2" }
148148
# When updating salsa, make sure to also update the revision in `fuzz/Cargo.toml`
149-
salsa = { git = "https://github.com/salsa-rs/salsa.git", rev = "29ab321b45d00daa4315fa2a06f7207759a8c87e", default-features = false, features = [
149+
salsa = { path = "../salsa", default-features = false, features = [
150150
"compact_str",
151151
"macros",
152152
"salsa_unstable",
@@ -268,12 +268,8 @@ large_stack_arrays = "allow"
268268

269269

270270
[profile.release]
271-
# Note that we set these explicitly, and these values
272-
# were chosen based on a trade-off between compile times
273-
# and runtime performance[1].
274-
#
275-
# [1]: https://github.com/astral-sh/ruff/pull/9031
276-
lto = "thin"
271+
strip = true
272+
lto = "fat"
277273
codegen-units = 16
278274

279275
# Some crates don't change as much but benefit more from
@@ -283,6 +279,8 @@ codegen-units = 16
283279
codegen-units = 1
284280
[profile.release.package.ruff_python_ast]
285281
codegen-units = 1
282+
[profile.release.package.salsa]
283+
codegen-units = 1
286284

287285
[profile.dev.package.insta]
288286
opt-level = 3
@@ -298,11 +296,30 @@ opt-level = 3
298296
[profile.dev.package.ruff_python_parser]
299297
opt-level = 1
300298

299+
# This profile is meant to mimic the `release` profile as closely as
300+
# possible, but using settings that are more beneficial for iterative
301+
# development. That is, the `release` profile is intended for actually
302+
# building the release, where as `profiling` is meant for building ty/ruff
303+
# for running benchmarks.
304+
#
305+
# The main differences here are to avoid stripping debug information
306+
# and disabling fat lto. This does result in a mismatch between our release
307+
# configuration and our benchmarking configuration, which is unfortunate.
308+
# But compile times with `lto = fat` are completely untenable.
309+
#
310+
# This setup does risk that we are measuring something in benchmarks
311+
# that we are shipping, but in order to make those two the same, we'd
312+
# either need to make compile times way worse for development, or take
313+
# a hit to binary size and a slight hit to runtime performance in our
314+
# release builds.
315+
#
301316
# Use the `--profile profiling` flag to show symbols in release mode.
302317
# e.g. `cargo build --profile profiling`
303318
[profile.profiling]
304319
inherits = "release"
305-
debug = 1
320+
strip = false
321+
debug = "full"
322+
lto = false
306323

307324
# The profile that 'cargo dist' will build with.
308325
[profile.dist]

0 commit comments

Comments
 (0)