-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Avoid some smaller allocations in ItemGroupintrinsicTask #11779
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?
Avoid some smaller allocations in ItemGroupintrinsicTask #11779
Conversation
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 seeks to reduce unnecessary allocations in the ItemGroupIntrinsicTask by replacing LINQ-based filtering with direct iteration and by optimizing HashSet initialization.
- Replaces LINQ queries with direct foreach loops in metadata removal sections
- Initializes a HashSet with a preset capacity in EvaluateExcludePaths to avoid rehashing
src/Build/BackEnd/Components/RequestBuilder/IntrinsicTasks/ItemGroupIntrinsicTask.cs
Outdated
Show resolved
Hide resolved
src/Build/BackEnd/Components/RequestBuilder/IntrinsicTasks/ItemGroupIntrinsicTask.cs
Outdated
Show resolved
Hide resolved
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.
LGTM with minor naming correction.
Also one test has failed so I'm re-running it. If it passes, we have a bunch of flaky ones. Otherwise we will need to dig deeper into it.
src/Build/BackEnd/Components/RequestBuilder/IntrinsicTasks/ItemGroupIntrinsicTask.cs
Outdated
Show resolved
Hide resolved
src/Build/BackEnd/Components/RequestBuilder/IntrinsicTasks/ItemGroupIntrinsicTask.cs
Outdated
Show resolved
Hide resolved
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.
Looks good for me, thank you for the improvements.
I have just a couple of renaming proposals.
Some naming tweaks.
I've attempted the suggested naming fixes in the github UI. If I messed up, I will have to clone into VS to fix properly. |
Fixes #
Context
Changes Made
Testing
Notes