Skip to content

Clamp instead of asserting in FileEncoder::write_with #116188

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

Closed
wants to merge 1 commit into from

Conversation

saethlin
Copy link
Member

r? @WaffleLapkin

If this isn't the regression mentioned in #115542 (comment) I'd have to actually look into it.

@saethlin
Copy link
Member Author

@bors try @rust-timer queue

@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 27, 2023
@bors
Copy link
Collaborator

bors commented Sep 27, 2023

⌛ Trying commit 4a17971 with merge af63746...

bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 27, 2023
Clamp instead of asserting in FileEncoder::write_with

r? `@WaffleLapkin`

If this isn't the regression mentioned in rust-lang#115542 (comment) I'd have to actually look into it.
@bors
Copy link
Collaborator

bors commented Sep 27, 2023

☀️ Try build successful - checks-actions
Build commit: af63746 (af637469c05c6cbe82a24da7cb3c3fd6b8879af2)

@lqd
Copy link
Member

lqd commented Sep 27, 2023

@rust-timer build af63746

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (af63746): comparison URL.

Overall result: ❌ regressions - ACTION NEEDED

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

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

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.3% [0.2%, 0.4%] 19
Regressions ❌
(secondary)
0.5% [0.5%, 0.5%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.3% [0.2%, 0.4%] 19

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

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

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 631.857s -> 630.663s (-0.19%)
Artifact size: 317.04 MiB -> 317.00 MiB (-0.01%)

@rustbot rustbot added the perf-regression Performance regression. label Sep 27, 2023

#[cold]
#[inline(never)]
fn panic_invalid_write<const N: usize>(written: usize) {
Copy link
Member

Choose a reason for hiding this comment

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

haven't caught it during the original review, but if we'll leave this in, this funciton should probably return !

@WaffleLapkin WaffleLapkin 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-review Status: Awaiting review from the assignee but also interested parties. labels Sep 27, 2023
@saethlin
Copy link
Member Author

The point of this PR was to figure out if this is the regression in question. The perf report above says it isn't.

It's upsetting that this makes things slower but it's cool that we now know the assertion doesn't have runtime cost compared to the sound alternatives.

@saethlin saethlin closed this Sep 29, 2023
@saethlin saethlin deleted the maybe-regression branch December 14, 2023 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf-regression Performance regression. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants