Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Describe why size_align have not been inlined so far #79827

Merged
merged 1 commit into from Jan 3, 2021

Conversation

tmiasko
Copy link
Contributor

@tmiasko tmiasko commented Dec 8, 2020

although it is used only in one place.

@rust-highfive
Copy link
Collaborator

r? @kennytm

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 8, 2020
@Xanewok
Copy link
Member

Xanewok commented Dec 8, 2020

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Dec 8, 2020

📌 Commit dc7325e411910d8f325af84c8ad162408249ffa7 has been approved by Xanewok

@bors bors 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 Dec 8, 2020
@kennytm
Copy link
Member

kennytm commented Dec 8, 2020

@bors r-

we tried once before in #72189 and failed, please show what has changed this time.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 8, 2020
@kennytm
Copy link
Member

kennytm commented Dec 8, 2020

@bors rollup=never

@Xanewok
Copy link
Member

Xanewok commented Dec 8, 2020

Oh, woops, sorry for the noise. It does look innocuous; might be worth adding a comment for posterity on why it's perf-sensitive/the way it is right now.

@Mark-Simulacrum
Copy link
Member

r=me with a comment added, fwiw

@Mark-Simulacrum
Copy link
Member

(i.e., a comment instead of the current change)

@Xanewok
Copy link
Member

Xanewok commented Dec 9, 2020

For completeness' sake:

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion

@bors
Copy link
Contributor

bors commented Dec 9, 2020

⌛ Trying commit dc7325e411910d8f325af84c8ad162408249ffa7 with merge 69c935bbedf41328fef53fd877e4a48df302d2f5...

@bors
Copy link
Contributor

bors commented Dec 9, 2020

☀️ Try build successful - checks-actions
Build commit: 69c935bbedf41328fef53fd877e4a48df302d2f5 (69c935bbedf41328fef53fd877e4a48df302d2f5)

@rust-timer
Copy link
Collaborator

Queued 69c935bbedf41328fef53fd877e4a48df302d2f5 with parent db85512, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking try commit (69c935bbedf41328fef53fd877e4a48df302d2f5): comparison url.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying rollup- to bors.

Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up.

@bors rollup=never
@rustbot modify labels: +S-waiting-on-review -S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 9, 2020
@tmiasko
Copy link
Contributor Author

tmiasko commented Dec 9, 2020

Thanks for catching this @kennytm. What prompted me to made this change in the first place, was the number of codegen items created for size_align. In retrospect, it is not surprising that it could cause a shift in partitioning. While partitioning is generally stable, when it finally changes, the change tends to be substantial. Looking again at mono-items and their partitioning in a crate I was investigating, this indeed introduced quite a shift.

Given the number of codegen item, the effect on partitioning likely generalizes, although I see no reason to except impact on quality of produced code to be in any particular direction, but since this is not captured by rustc perf benchmarks (except for rustc), leaving this as is seems like a good decision for now.

I added a comment describing why the function wasn't inlined so far.

@tmiasko tmiasko changed the title Inline implementation of size_align Describe why size_align have not been inlined so far Dec 9, 2020
@kennytm
Copy link
Member

kennytm commented Dec 9, 2020

@bors rollup

Copy link
Member

@kennytm kennytm left a comment

Choose a reason for hiding this comment

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

r=me or Mark-Simulacrum after fixing comment

library/core/src/alloc/layout.rs Outdated Show resolved Hide resolved
@bjorn3
Copy link
Member

bjorn3 commented Jan 2, 2021

I wonder if calling the size_of and align_of intrinsics directly instead of the core::mem wrappers would fix the perf regression when inlining size_align.

@kennytm
Copy link
Member

kennytm commented Jan 2, 2021

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jan 2, 2021

📌 Commit cf5bd26 has been approved by kennytm

@bors bors 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. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 2, 2021
@bors
Copy link
Contributor

bors commented Jan 3, 2021

⌛ Testing commit cf5bd26 with merge 05dfaba...

@bors
Copy link
Contributor

bors commented Jan 3, 2021

☀️ Test successful - checks-actions
Approved by: kennytm
Pushing 05dfaba to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 3, 2021
@bors bors merged commit 05dfaba into rust-lang:master Jan 3, 2021
@rustbot rustbot added this to the 1.51.0 milestone Jan 3, 2021
@tmiasko tmiasko deleted the size-align branch January 3, 2021 10:59
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. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants