msbuild icon indicating copy to clipboard operation
msbuild copied to clipboard

use struct enumerator instead of using IEnumerable through yield retu…

Open ttstanley opened this issue 5 months ago • 0 comments

…rns to prevent allocations

Fixes #

Context

We can see through traces that there are allocations due to the statemachine created to track yield returning IEnumerable. (This can be shown with the type <FindAssemblyName>d_29 in image below.) image

Changes Made

  • To fix this issue, I created a struct enumerator that would wrap the collection to enumerate over rather than needing to use IEnumerable through yield returns.

Notes

ttstanley avatar Jun 09 '25 18:06 ttstanley