Skip to content

Commit a93618e

Browse files
MichaReiserntBre
andauthored
Enable lto=fat (#20863)
Co-authored-by: Brent Westbrook <36778786+ntBre@users.noreply.github.com>
1 parent 9e1aafd commit a93618e

File tree

1 file changed

+24
-7
lines changed

1 file changed

+24
-7
lines changed

Cargo.toml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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 aren't 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)