Skip to content

Invoke in ElementUtil and ElementProxy cause unnecessary delegate allocations #10679

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

Open
h3xds1nz opened this issue Mar 30, 2025 · 0 comments
Open
Assignees
Labels
Performance Performance related issue

Comments

@h3xds1nz
Copy link
Member

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

@h3xds1nz h3xds1nz added the Performance Performance related issue label Mar 30, 2025
@h3xds1nz h3xds1nz self-assigned this Mar 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Performance Performance related issue
Projects
None yet
Development

No branches or pull requests

1 participant