-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Don't fold in Instantiate when there's nothing to fold #142317
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
base: master
Are you sure you want to change the base?
Conversation
@bors2 try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Don't fold in Instantiate when there's nothing to fold Maybe this helps idk r? lcnr
i feel like ive tested this before lol |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (4b9e637): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -2.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary 2.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 755.415s -> 754.049s (-0.18%) |
I think the perf wins outweigh the perf hits. @rustbot ready |
@@ -622,6 +622,10 @@ impl<I: Interner, T: TypeFoldable<I>> ty::EarlyBinder<I, T> { | |||
where | |||
A: SliceLike<Item = I::GenericArg>, | |||
{ | |||
// Nothing to fold. | |||
if !cfg!(debug_assertions) && args.is_empty() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We still fold if cfg!(debug_assertions)
since the arg folder can detect out of bound arg instantiations, and that's useful in debug builds.
I believe that this is morally a debug assertion, since we never expect it in practice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of still folding with debug assertions, check whether the value has params.
r=me after this nit
Maybe this helps idk
r? lcnr