Skip to content
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

Gesture recognizers unnecessarily produce registrar methods calling into generic class #18597

Open
filipnavara opened this issue Jul 28, 2023 · 0 comments
Labels
enhancement The issue or pull request is an enhancement performance If an issue or pull request is related to performance
Milestone

Comments

@filipnavara
Copy link
Contributor

Static registrar calls are extremely inefficient when the target is a generic class. This happens to produce that code in the binding themselves:

[Register ("__UIGestureRecognizerGenericCB")]
internal class Callback<T> : Token where T : UIGestureRecognizer {
Action<T> action;
internal Callback (Action<T> action)
{
this.action = action;
}
[Export ("target:")]
[Preserve (Conditional = true)]
public void Activated (T sender) => action (sender);
}

It can likely be avoided by introducing non-generic parent. It's also a non-issue with the new managed static registrar.

@rolfbjarne rolfbjarne added enhancement The issue or pull request is an enhancement performance If an issue or pull request is related to performance labels Aug 1, 2023
@rolfbjarne rolfbjarne added this to the Future milestone Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue or pull request is an enhancement performance If an issue or pull request is related to performance
Projects
None yet
Development

No branches or pull requests

2 participants