-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
&usize::<= is much slower than usize::<= #105259
Copy link
Copy link
Open
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
While solving AoC Day 4 I ran into the following performance difference:
As you can see, using
|&&(a, b, c, d)|on the same closure is 2.6 times faster than|(a, b, c, d)|.Viewing the compiled code makes this clear: https://rust.godbolt.org/z/oaeaGGPK7
Is this a compiler behavior a developer should know / expect?
Meta
Thanks to @Arnavion for pointing this out.
rustc --version --verbose: