Unnecessary delegate/closure allocations in UIElementAutomationPeer
- Dominant language
- C#
- Stars
- 7.7k
- Forks
- 1.3k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 61
Description
_Note that I will submit a PR in the coming days for this issue, so its more of an FYI._
### Description
`GetChildrenCore` and `GetRootAutomationPeer` both allocate a new delegate and closure each time they execute with the call to `iterate` function that the callback is passed into. Given that both capture a single local parameter, we can easily just modify the function signature and pass the parameter by `ref`, saving easily 220 MB in this case.
### Showcase

### Repro
Note: This repro is specifically crafted to highlight an issue like this.
https://github.com/h3xds1nz/UIAPerformancePitfalls
Contributor guide
Assessment
This issue has not been assessed yet.