Skip to content

Invoke in ElementUtil and ElementProxy cause unnecessary delegate allocations #10679

@h3xds1nz

Description

@h3xds1nz

I might bundle this up with some Dispatcher improvements to support generic invocations at least for internal use, so it would be a bigger PR. We will see, won't be right away.

Description

The Invoke method from ElementUtil is causing unnecessary allocations due to the attempt to catch exceptions from another thread (if invoked on) and re-throw on the current thread. This further comes the from already allocating delegates inside ElementProxy that use this Invoke exclusively.

Showcase

Image

Repro

Note: This repro is specifically crafted to highlight an issue like this.

https://github.com/h3xds1nz/UIAPerformancePitfalls

Metadata

Metadata

Assignees

Labels

PerformancePerformance related issue

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions