Skip to content

A couple polonius constraints perf improvements - #163027

Merged
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
jackh726:polonius-perf
Sep 21, 2026
Merged

rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
jackh726:polonius-perf

Conversation

@jackh726

Copy link
Copy Markdown
Member

These give some nice wins in situations where traversal dominates, independent of the lazy liveness change. (This does conflict but the changes are conceptually independent.)

r? lqd

LLM-generated perf summary table image

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 19, 2026
@jackh726

Copy link
Copy Markdown
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 19, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 19, 2026
A couple polonius constraints perf improvements
@rust-bors

This comment has been minimized.

@jackh726

Copy link
Copy Markdown
Member Author

Disclosure: An LLM was used to identify this perf effect and to check the performance of the solution.

@rust-bors

rust-bors Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 1d91cb4 (1d91cb490050ad9537ce8f1194876a97f435a15a)
Base parent: 36b04f3 (36b04f3ad12a98b1a3cf9efe5313306ef7d5848d)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (1d91cb4): comparison URL.

Overall result: ✅ improvements - no action needed

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.

@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
Improvements ✅
(primary)
-0.4% [-1.0%, -0.2%] 17
Improvements ✅
(secondary)
-0.3% [-0.5%, -0.2%] 9
All ❌✅ (primary) -0.4% [-1.0%, -0.2%] 17

Max RSS (memory usage)

Results (primary -2.7%)

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)
- - 0
Improvements ✅
(primary)
-2.7% [-2.7%, -2.7%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.7% [-2.7%, -2.7%] 1

Cycles

Results (primary 33.1%)

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

mean range count
Regressions ❌
(primary)
33.1% [2.2%, 64.0%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 33.1% [2.2%, 64.0%] 2

Binary size

Results (primary -0.0%, secondary -0.1%)

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)
- - 0
Improvements ✅
(primary)
-0.0% [-0.1%, -0.0%] 15
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.0%] 5
All ❌✅ (primary) -0.0% [-0.1%, -0.0%] 15

Bootstrap: 497.193s -> 495.146s (-0.41%)
Artifact size: 408.84 MiB -> 408.91 MiB (0.02%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 19, 2026
Comment thread compiler/rustc_borrowck/src/polonius/constraints.rs Outdated
Comment thread compiler/rustc_borrowck/src/polonius/constraints.rs
Comment thread compiler/rustc_borrowck/src/polonius/constraints.rs
Comment thread compiler/rustc_borrowck/src/polonius/constraints.rs
Comment thread compiler/rustc_borrowck/src/polonius/constraints.rs Outdated

@lqd lqd left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me with the comments fixed, and discussing the tiny questions

View changes since this review

@jackh726

Copy link
Copy Markdown
Member Author

@bors r=lqd

@rust-bors

rust-bors Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

📌 Commit c690179 has been approved by lqd

It is now in the queue for this repository.

🌲 The tree is currently closed for pull requests below priority 5. This pull request will be tested once the tree is reopened.

Reason for tree closure: GitHub outage

@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-review Status: Awaiting review from the assignee but also interested parties. labels Sep 19, 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 Sep 21, 2026
@rust-bors

rust-bors Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: lqd
Duration: 3h 11m 29s
Pushing d287eb7 to main...

@rust-bors
rust-bors Bot merged commit d287eb7 into rust-lang:main Sep 21, 2026
14 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Sep 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 bba5310 (parent) -> d287eb7 (this PR)

Test differences

Show 4 test diffs

4 doctest diffs were found. These are ignored, as they are noisy.

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard d287eb7a292caa8abbe12051dce2ee707fe03200 --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. test-x86_64-gnu-llvm-21-1: 34m 14s -> 57m 40s (+68.5%)
  2. test-x86_64-rust-for-linux: 33m 46s -> 55m 48s (+65.3%)
  3. test-x86_64-gnu-llvm-21-2: 1h 3m -> 1h 41m (+60.4%)
  4. test-x86_64-gnu-gcc: 52m 3s -> 1h 17m (+48.5%)
  5. test-i686-gnu-1: 2h 16m -> 1h 18m (-42.7%)
  6. dist-x86_64-solaris: 1h 15m -> 1h 46m (+39.9%)
  7. test-x86_64-gnu-llvm-21-3: 1h 23m -> 1h 55m (+38.5%)
  8. dist-powerpc64-linux-musl: 1h 12m -> 1h 39m (+36.8%)
  9. test-x86_64-msvc-ext3: 1h 6m -> 1h 30m (+35.6%)
  10. test-x86_64-msvc-ext1: 2h 23m -> 1h 34m (-34.5%)
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.

@jackh726
jackh726 deleted the polonius-perf branch September 21, 2026 02:03
@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (d287eb7): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -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
Improvements ✅
(primary)
-0.5% [-1.1%, -0.2%] 16
Improvements ✅
(secondary)
-0.3% [-0.5%, -0.2%] 9
All ❌✅ (primary) -0.5% [-1.1%, -0.2%] 16

Max RSS (memory usage)

Results (primary 2.3%)

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

mean range count
Regressions ❌
(primary)
2.3% [2.2%, 2.4%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.3% [2.2%, 2.4%] 2

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: 496.585s -> 503.997s (1.49%)
Artifact size: 408.87 MiB -> 408.93 MiB (0.01%)

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. 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.

4 participants