-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Reduce allocations in LazyItemEvaluator.ProcessMetadataElements by avoiding enumerator boxing #12908
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: main
Are you sure you want to change the base?
Reduce allocations in LazyItemEvaluator.ProcessMetadataElements by avoiding enumerator boxing #12908
Conversation
…oiding enumerator boxing
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.
Pull request overview
This PR optimizes ProcessMetadataElements to reduce allocations by eliminating enumerator boxing. The change moves metadata element addition from a single AddRange call to individual Add calls within the existing loop.
Key changes:
- Removed
AddRange(itemElement.Metadata)call that caused boxing of struct enumerator - Added individual
Add(metadatumElement)calls inside the existing foreach loop - Eliminated duplicate enumeration of the Metadata collection
|
@rainersigwald thanks for reviewing. I don't have permissions to merge. Could you please merge it if you do. |
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.
I don't know that I have merge permissions either, but I've spent a lot of time in LazyItemEvaluator lately, and this looks good to me.
|
We'll merge after an insertion with #12950 validates that we haven't accidentally regressed VS while we were missing coverage. |
This pull request was generated by the VS Perf Rel AI Agent. Please review this AI-generated PR with extra care! For more information, visit our wiki. Please share feedback with TIP Insights
Best practices wiki
See related failure in PRISM
ADO work item