Skip to content

Skip computing extra liveness info if borrow_set is empty - #161252

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
jackh726:polonius-liveness-perf
Aug 21, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
jackh726:polonius-liveness-perf

Conversation

@jackh726

@jackh726 jackh726 commented Aug 17, 2026 •

Copy link
Copy Markdown
Member

With polonius alpha, we currently compute liveness for a larger set of locals than NLL. However, this extra liveness only matters if there are borrows; so we can skip the extra work if there aren't any.

r? lqd

@rustbot

This comment was marked as outdated.

@jackh726

Copy link
Copy Markdown
Member Author

@bors try @rust-timer queue

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Aug 17, 2026
Skip computing extra liveness info if borrow_set is empty
@jackh726

Copy link
Copy Markdown
Member Author

Disclosure: An LLM was used to dig into the icu4x (and other) regressions, and identified that that and other cases have no loans - and so that this is a candidate fix.

@rust-bors

rust-bors Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 4b205ca (4b205caca087d3a42150f9866c94ad2cad745472)
Base parent: 6d656b1 (6d656b1efca82491a110b476ac9bbe712628ccb6)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (4b205ca): comparison URL.

Overall result: ❌✅ regressions and improvements - please read:

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

@bors rollup=never rustc-perf
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.1% [0.0%, 0.2%] 5
Improvements ✅
(primary)
-0.6% [-1.5%, -0.1%] 15
Improvements ✅
(secondary)
-0.3% [-0.8%, -0.1%] 16
All ❌✅ (primary) -0.6% [-1.5%, -0.1%] 15

Max RSS (memory usage)

Results (primary 1.3%, secondary 1.2%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.3% [0.5%, 2.5%] 5
Regressions ❌
(secondary)
3.2% [3.2%, 3.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.8% [-0.8%, -0.8%] 1
All ❌✅ (primary) 1.3% [0.5%, 2.5%] 5

Cycles

This perf run didn't have relevant results for this metric.

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 468.493s -> 459.261s (-1.97%)
Artifact size: 398.93 MiB -> 398.95 MiB (0.01%)

@rustbot rustbot added the perf-regression Performance regression. label Aug 17, 2026
Comment thread compiler/rustc_borrowck/src/type_check/liveness/mod.rs
@lqd

lqd commented Aug 20, 2026 •

Copy link
Copy Markdown
Member

The small regressions in the perf run look like noise to me.

r=me with:

  • the comment + FIXME suggestion applied
  • filling the PR description with a quick summary

@rustbot author

@rustbot rustbot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Aug 20, 2026
@rust-cloud-vms
rust-cloud-vms Bot force-pushed the polonius-liveness-perf branch from 052c0b5 to d578849 Compare August 20, 2026 16:30
@rustbot

This comment was marked as resolved.

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Aug 20, 2026
@rustbot

This comment has been minimized.

@rust-cloud-vms
rust-cloud-vms Bot force-pushed the polonius-liveness-perf branch from d578849 to ea0a481 Compare August 20, 2026 16:33
@jackh726

Copy link
Copy Markdown
Member Author

@bors r=lqd

@rust-bors

rust-bors Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

📌 Commit ea0a481 has been approved by lqd

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 20, 2026
@rust-bors

This comment has been minimized.

@rust-bors rust-bors Bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 21, 2026
@rust-bors

rust-bors Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: lqd
Duration: 3h 4m 18s
Pushing c656540 to main...

@rust-bors
rust-bors Bot merged commit c656540 into rust-lang:main Aug 21, 2026
14 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Aug 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor
What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing a872286 (parent) -> c656540 (this PR)

Test differences

No test diffs found

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard c656540d6467dee1381f0cbd882412d6bd1cd5ae --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. x86_64-msvc-ext3: 1h 56m -> 1h 6m (-43.2%)
  2. x86_64-gnu-miri: 1h 31m -> 52m 53s (-42.3%)
  3. i686-gnu-2: 1h 47m -> 1h 4m (-39.7%)
  4. dist-x86_64-solaris: 1h 13m -> 1h 42m (+39.0%)
  5. x86_64-gnu-stdlib-semver-check: 18m 49s -> 11m 43s (-37.7%)
  6. dist-s390x-linux: 1h 6m -> 1h 29m (+35.1%)
  7. x86_64-gnu-llvm-21-2: 1h 13m -> 1h 36m (+31.3%)
  8. optional-x86_64-gnu-autodiff: 36m 56s -> 48m 29s (+31.3%)
  9. x86_64-gnu-gcc-core-tests: 17m 41s -> 12m 14s (-30.8%)
  10. aarch64-apple-1: 1h 35m -> 2h 3m (+30.1%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (c656540): comparison URL.

Overall result: ❌✅ regressions and improvements - please read:

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.1% [0.1%, 0.1%] 1
Regressions ❌
(secondary)
0.3% [0.2%, 0.5%] 27
Improvements ✅
(primary)
-0.7% [-1.5%, -0.1%] 11
Improvements ✅
(secondary)
-0.3% [-0.9%, -0.0%] 19
All ❌✅ (primary) -0.6% [-1.5%, 0.1%] 12

Max RSS (memory usage)

Results (primary 3.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
3.4% [1.5%, 5.2%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.4% [1.5%, 5.2%] 2

Cycles

Results (secondary -0.6%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.7% [1.7%, 1.7%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.9% [-2.9%, -2.9%] 1
All ❌✅ (primary) - - 0

Binary size

Results (primary 0.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.0% [0.0%, 0.0%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [0.0%, 0.0%] 3

Bootstrap: 468.499s -> 470.079s (0.34%)
Artifact size: 400.07 MiB -> 400.19 MiB (0.03%)

@Mark-Simulacrum

Copy link
Copy Markdown
Member

@rustbot label: +perf-regression-triaged

As mentioned above (#161252 (comment)), regressions are maybe noise and definitely outweighed by the improvements.

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Aug 24, 2026
@jackh726
jackh726 deleted the polonius-liveness-perf branch September 7, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants