Skip to content

Conversation

@ReillyBrogan
Copy link
Member

Build dependencies with optimizations. Given that dependency compilation happens very infrequently this gives us most of the benefit of optimizations without increasing build times in the most common case of a developer rebuilding the project after making code changes (but not dependency changes).

Also bring back compressed debug symbols as an alternative for shrinking the binary with "line-tables-only". This shrinks the binary further than line-tables-only but without interfering with the ability to attach a debugger. To get back some of the lost linker time switch to using the mold linker.

… symbols

Build dependencies with optimizations. Given that dependency compilation happens very infrequently this gives us most of the benefit of optimizations without increasing build times in the most common case of a developer rebuilding the project after making code changes (but not dependency changes).

Also bring back compressed debug symbols as an alternative for shrinking the binary with "line-tables-only". This shrinks the binary further than line-tables-only but without interfering with the ability to attach a debugger. To get back some of the lost linker time switch to using the mold linker.

Signed-off-by: Reilly Brogan <[email protected]>
# shown by RUST_BACKTRACE=1 and other debug utilities. It should also be helpful once we have ABI reports. Upstream
# hasn't switched to it yet by default due to stable distros not having new enough tools, but that doesn't matter for us
rustflags = [
"-Clink-arg=-fuse-ld=mold",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should be configuring mold on a per-project basis, as this requires anybody who wants to contribute to have it installed, increasing friction. This should be a user-wide config that we merely recommend IMO. By the way, wild is faster still in my experience :)

Comment on lines +120 to +122
# Build dependencies (but not workspace members) in release mode
[profile.dev.package."*"]
opt-level = 3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this. Yes, full rebuilds don't happen that often but for example when somebody uses nightly, they might upgrade their toolchain and clean out cargo target dirs every week or so (I personally use nightly and update every few weeks). I'd rather we enable optimizations for specific dependencies that we know to matter for runtime performance (if that is the problem being solved here - I haven't had issues with debug builds being too slow myself).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants