rust-lang / rust-lang/polonius

Runaway borrow-check times for `tinyvec` crate

Open
#162 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.7k
Forks
86
PR merge metrics
No merged PRs in 30d

Description

It can be reproduced with the following script, assuming a nightly compiler is available.

git clone https://github.com/Lokathor/tinyvec
cd tinyvec
git checkout 0e0dc46d37b19d2a350896ed788c84218812b740
cargo +nightly check -Z timings # about 3.5s
mkdir -p .cargo && echo $'[build]\nrustflags = "-Zpolonius"' > .cargo/config.toml
cargo +nightly check -Z timings # about 2m40s

I thought I am posting this here in case it's an interesting use case and maybe even a low-hanging performance issue to resolve. This one stood out as it was the only one out of 114 crates being compiled that showed this kind of worst-case performance. Here is the full timings log.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report with the provided checkout and compare cargo +nightly check -Z timings with and without .cargo/config.toml enabling -Zpolonius. Inspect the linked cargo timing log to identify the slow crate or phase; done means explaining the runaway timing and validating an improvement against the reported baseline.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.