-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Reduce code size of assert_matches_failed
#100933
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
@bors r+ rollup=never |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
🙅 Please do not |
I'd like a perf run before this lands. The merge queue is very long right now, so it won't delay things. @bors r- |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 289d7cc with merge e935756a38fbc6620cbc9d1d14252f7cb0973460... |
This is very unlikely to have any effect on compilation perf, this function is only instatiated once. |
The perf runs also measure binary size, which I think this PR will affect? At least, that's my understanding of the description. I'm not sure why @joshtriplett marked this as rollup=never. |
☀️ Try build successful - checks-actions |
Queued e935756a38fbc6620cbc9d1d14252f7cb0973460 with parent ebfc7aa, future comparison URL. |
I marked it as rollup=never because it seemed like it might have an impact on generated code size in a way that would be nice to have separated from a rollup. |
Finished benchmarking commit (e935756a38fbc6620cbc9d1d14252f7cb0973460): comparison URL. Overall result: no relevant changes - no action neededBenchmarking 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. @bors rollup=never Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis 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.
CyclesResultsThis 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.
Footnotes |
The perf results show no changes to speed, memory usage, or binary size. The code is a little simpler, which is nice, but there's no evidence this will help size-constrained code. @bors r=JoshTriplett |
@bors rollup=always |
…r=JoshTriplett Reduce code size of `assert_matches_failed` Using `write_str` instead of `<str as Display>::fmt` avoids the `pad` function which is very expensive to have in size-constrained code.
…r=JoshTriplett Reduce code size of `assert_matches_failed` Using `write_str` instead of `<str as Display>::fmt` avoids the `pad` function which is very expensive to have in size-constrained code.
…r=JoshTriplett Reduce code size of `assert_matches_failed` Using `write_str` instead of `<str as Display>::fmt` avoids the `pad` function which is very expensive to have in size-constrained code.
Rollup of 8 pull requests Successful merges: - rust-lang#99064 (distinguish the method and associated function diagnostic information) - rust-lang#99920 (Custom allocator support in `rustc_serialize`) - rust-lang#100034 ( Elaborate all box dereferences in `ElaborateBoxDerefs`) - rust-lang#100076 (make slice::{split_at,split_at_unchecked} const functions) - rust-lang#100604 (Remove unstable Result::into_ok_or_err) - rust-lang#100933 (Reduce code size of `assert_matches_failed`) - rust-lang#100978 (Handle `Err` in `ast::LitKind::to_token_lit`.) - rust-lang#101010 (rustdoc: remove unused CSS for `.multi-column`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Using
write_str
instead of<str as Display>::fmt
avoids thepad
function which is very expensive to have in size-constrained code.