Skip to content

delegation: store child segment flag in PathSegment#158556

Open
aerooneqq wants to merge 1 commit into
rust-lang:mainfrom
aerooneqq:delegation-child-segment-perf
Open

delegation: store child segment flag in PathSegment#158556
aerooneqq wants to merge 1 commit into
rust-lang:mainfrom
aerooneqq:delegation-child-segment-perf

Conversation

@aerooneqq

Copy link
Copy Markdown
Contributor

This should reduce perf overhead of checking whether path segment is a delegation's child segment.

r? @petrochenkov

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 29, 2026
@petrochenkov

Copy link
Copy Markdown
Contributor

@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 Jun 29, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jun 29, 2026
delegation: store child segment flag in `PathSegment`
@rust-bors

rust-bors Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: ab95f53 (ab95f53da0952e11b0180d3d6de83e807f1ec82b)
Base parent: 63f05e3 (63f05e3635171e7ac3f9ca78bad6c71052cda5a3)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (ab95f53): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

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

Max RSS (memory usage)

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

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: 486.982s -> 486.289s (-0.14%)
Artifact size: 393.22 MiB -> 393.15 MiB (-0.02%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 29, 2026
@aerooneqq

Copy link
Copy Markdown
Contributor Author

There are no significant improvements, but many insignificant with significance factor 0.6 - 0.8, including typenum-1.18.0 which in regression PR had:

typenum-1.18.0 check incr-full llvm x64 0.11% 0.03% 4.12x
typenum-1.18.0 opt incr-full llvm x64 0.11% 0.03% 4.18x
typenum-1.18.0 debug incr-full llvm x64 0.11% 0.02% 4.63x

And in this PR:

typenum-1.18.0 check incr-full llvm x64 -0.12% 0.16% 0.79x
typenum-1.18.0 opt incr-full llvm x64 -0.12% 0.18% 0.68x
typenum-1.18.0 debug incr-full llvm x64 -0.12% 0.18% 0.68x

So I think we can consider perf regression from #157960 to be resolved here.

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 29, 2026
@aerooneqq aerooneqq marked this pull request as ready for review June 29, 2026 13:19
@rustbot

rustbot commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

HIR ty lowering was modified

cc @fmease

/// Whether this segment is a delegation's child segment:
/// `reuse Trait::foo`, in this case `foo` is a delegation's child segment.
/// Used for faster check during generic args lowering.
pub delegation_child_segment: bool,

@petrochenkov petrochenkov Jun 29, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Note: the PathSegment's size doesn't change, there's a corresponding assert at the bottom of the file.

View changes since the review

Comment thread compiler/rustc_hir/src/intravisit.rs Outdated
@petrochenkov

Copy link
Copy Markdown
Contributor

r=me after addressing #158556 (comment).
@rustbot author
@bors delegate+

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 29, 2026
@rust-bors

rust-bors Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

✌️ @aerooneqq, you can now approve this pull request!

If @petrochenkov told you to "r=me" after making some further change, then please make that change and post @bors r=petrochenkov.

View changes since this delegation.

@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 Jun 29, 2026
@rustbot

rustbot commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@aerooneqq aerooneqq force-pushed the delegation-child-segment-perf branch from 2bee069 to 91a762b Compare June 29, 2026 13:54
@aerooneqq

Copy link
Copy Markdown
Contributor Author

@bors r=petrochenkov

@rust-bors

rust-bors Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 91a762b has been approved by petrochenkov

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 Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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