-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Use SmallVector
in CombineFields::instantiate
.
#37322
Conversation
r? @Aatch (rust_highfive has picked a reviewer for you, use r? to override) |
We are going to have a "better" |
How soon? Is there a PR? I have some other patches in the pipeline that convert |
There's #37270 and its |
@arielb1 It's not general purpose though. This one is also weird because the libsyntax thing is specifically geared towards |
I have filed #37371 for generalizing |
@@ -181,7 +182,7 @@ impl<'infcx, 'gcx, 'tcx> CombineFields<'infcx, 'gcx, 'tcx> { | |||
a_is_expected: bool) | |||
-> RelateResult<'tcx, ()> | |||
{ | |||
let mut stack = Vec::new(); | |||
let mut stack = SmallVector::zero(); |
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.
Could you add a comment about the fact that the common case is one element?
This avoids 4% of malloc calls when compiling rustc-benchmarks/issue-32278-big-array-of-strings, and 1--2% for other benchmarks. A small win, but an easy one.
678bdd6
to
9270a92
Compare
@bors r+ Thanks! |
📌 Commit 9270a92 has been approved by |
⌛ Testing commit 9270a92 with merge ac468b6... |
Use `SmallVector` in `CombineFields::instantiate`. This avoids 4% of malloc calls when compiling rustc-benchmarks/issue-32278-big-array-of-strings, and 1--2% for other benchmarks. A small win, but an easy one.
This avoids 4% of malloc calls when compiling
rustc-benchmarks/issue-32278-big-array-of-strings, and 1--2% for other
benchmarks. A small win, but an easy one.