Skip to content

rustbuild: Disable multiple CGUs in stable release builds #45444

Closed
@petrochenkov

Description

@petrochenkov
Contributor

#45400 enabled multiple CGUs + ThinLTO in rustc builds to speedup bootstrap, however it made the produced compiler slower (see #45400 (comment) and below).

This is desirable for development builds, where build times are priority, but not for stable release builds that happen rarely (so build times don't matter much) and produce binaries used by majority of Rust users.

Enabling full LTO (#45400 (comment)) in stable release builds is also worth investigating.

Activity

added
T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
T-infraRelevant to the infrastructure team, which will review and decide on the PR/issue.
on Oct 22, 2017
Mark-Simulacrum

Mark-Simulacrum commented on Oct 23, 2017

@Mark-Simulacrum
Member

Responding to @michaelwoerister from this comment:

I agree that we should build stable and beta releases with just one CGU and whatever other performance optimization we can do. I think the only reason we don't use regular LTO for stable releases is that rustc is built out of Rust dylibs which are incompatible with LTO.

I'm personally not opposed to shipping faster stable/beta artifacts -- we already do this by disabling LLVM assertions for example, so I don't see why disabling ThinLTO is a bad thing here. Seems like a fairly clear win, at least until ThinLTO is no longer a loss.

@alexcrichton, @Mark-Simulacrum, do we have numbers on how this influences build times in CI?

Not that I know of. Travis is problematic due to running our builds always at least once extra and often more than that, but we may be able to get data from @aidanhs. I'd also be interested in relative performance increases locally (building the compiler itself) but that just needs someone to be patient enough to rebuild the compiler with and without this patch.

michaelwoerister

michaelwoerister commented on Oct 23, 2017

@michaelwoerister
Member

I'm personally not opposed to shipping faster stable/beta artifacts -- we already do this by disabling LLVM assertions for example

That would have been my line of argument too.

alexcrichton

alexcrichton commented on Oct 23, 2017

@alexcrichton
Member

Yes as @michaelwoerister mentioned the current design with dylibs inhibits full LTO (in general procedural macros throw a wrench into full LTO).

For disabling multiple CGUs/ThinLTO it seems fine to do that on release builds which as mentioned already have other tweaks anyway.

modified the milestones: 1.22, 1.21 on Oct 23, 2017
aidanhs

aidanhs commented on Oct 24, 2017

@aidanhs
Member

I might be able to get some stats if you let me know what you'd like to compare - before and after a particular commit I assume? There's a lot of noise in Travis (particularly at the moment) so there may not be very high quality results.

removed this from the 1.22 milestone on Nov 15, 2017

20 remaining items

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

Metadata

Metadata

Labels

C-enhancementCategory: An issue proposing an enhancement or a PR with one.P-highHigh priorityT-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-infraRelevant to the infrastructure team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @jkordish@alexcrichton@nikomatsakis@aidanhs@michaelwoerister

      Issue actions

        rustbuild: Disable multiple CGUs in stable release builds · Issue #45444 · rust-lang/rust