Skip to content

NLL can be very slow #47597

@SimonSapin

Description

@SimonSapin

In servo/html5ever@3d5e24b, RUSTFLAGS="-Ztime-passes" cargo +nightly-2018-01-19 build -j1 (with -j1 to make time-passes readable) ends in 31 seconds.

With -Znll added, it takes 233 seconds, a ~7× slowdown.

Each log contains 41 MIR borrow checking lines. Without NLL they’re all under 1 second. With it, the ones over 1 second are:

  time: 18.400; rss: 252MB	MIR borrow checking
  time: 87.612; rss: 211MB	MIR borrow checking
  time: 60.710; rss: 120MB	MIR borrow checking
  time: 37.651; rss: 188MB	MIR borrow checking

They add up to roughly all of the time difference. They are for the serde, syn, serde_derive_internals, and serde_derive crates respectively.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-NLLArea: Non-lexical lifetimes (NLL)C-enhancementCategory: An issue proposing an enhancement or a PR with one.I-compiletimeIssue: Problems and improvements with respect to compile times.NLL-performantWorking towards the "performance is good" goalT-compilerRelevant to the compiler 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

    Issue actions