Skip to content

regression in compilation times on 1.31.0-nightly (4bd4e4130 2018-10-25) #55390

Closed as not planned
@Geal

Description

@Geal

hello,
I have some code that's heavily relying on futures and impl trait for which I have different compilation behaviours on stable (1.30) and nightly (I'm running rust on OSX, but a colleague reproduced it on Linux as well):

1.30 stable:

  • compiles in 15s in debug

1.31.0-nightly (4bd4e41 2018-10-25):

  • if compiled directly with cargo +nightly build I get the following error:
error: reached the type-length limit while instantiating `<std::vec::IntoIter<futures::future::join_all::ElemState<futures...`
  |
  = note: consider adding a `#![type_length_limit="2097152"]` attribute to your crate
  • if I add the type_length_limit attribute, it compiles in 30s
  • if I measure time for compilation passes with RUSTFLAGS="-Z time-passes" rustup run nightly cargo build:
  time: 0.034   lint checking
  time: 0.002   resolving dependency formats
    time: 0.000 write metadata
      time: 0.002       collecting roots
      time: 16.834      collecting mono items
    time: 16.836        monomorphization collection
    time: 0.031 codegen unit partitioning
    time: 0.000 write allocator module
    time: 0.000 llvm function passes [2mhp9uvb4kzbepub]
    time: 0.003 llvm module passes [2mhp9uvb4kzbepub]
    time: 0.001 llvm function passes [36y3779vszzmsrb1]
    time: 0.003 llvm module passes [36y3779vszzmsrb1]
    time: 0.267 codegen passes [2mhp9uvb4kzbepub]
    time: 0.001 llvm function passes [2nrwubyljtrub0c7]
    time: 0.002 llvm module passes [2nrwubyljtrub0c7]
    time: 0.001 llvm function passes [2mz1h59pje44dj1g]
    time: 0.003 llvm module passes [2mz1h59pje44dj1g]
    time: 0.193 codegen passes [36y3779vszzmsrb1]
    time: 0.209 codegen passes [2nrwubyljtrub0c7]
    time: 0.197 codegen passes [2mz1h59pje44dj1g]
    time: 0.002 llvm function passes [1moek2n93vgg6psh]
    time: 0.002 llvm module passes [1moek2n93vgg6psh]
    time: 0.000 llvm function passes [37ep5o26a6aq0f2a]
    time: 0.003 llvm module passes [37ep5o26a6aq0f2a]
    time: 0.176 codegen passes [37ep5o26a6aq0f2a]
    time: 0.003 llvm function passes [4cfjod4ovqous12r]
    time: 0.269 codegen passes [1moek2n93vgg6psh]
    time: 0.003 llvm module passes [4cfjod4ovqous12r]
    time: 0.001 llvm function passes [590t4nab5qyp6vss]
    time: 0.002 llvm module passes [590t4nab5qyp6vss]
    time: 0.000 llvm function passes [27my216ny6cmtwvn]
    time: 0.003 llvm module passes [27my216ny6cmtwvn]
    time: 0.193 codegen passes [590t4nab5qyp6vss]
    time: 0.177 codegen passes [27my216ny6cmtwvn]
    time: 0.307 codegen passes [4cfjod4ovqous12r]
    time: 0.000 llvm function passes [1pmi26f1ndz2bwfm]
    time: 0.002 llvm module passes [1pmi26f1ndz2bwfm]
    ...

Unfortunately, this is coming from internal code that I won't be able to share, and I'm not sure I would be able to provide a minimal reproducible case, but I could bisect nightlies since the last release. Any suggestion of which commit I should start at to speed up the process?

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcE-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleI-compiletimeIssue: Problems and improvements with respect to compile times.P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions