-
-
Notifications
You must be signed in to change notification settings - Fork 205
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
MAUI - Breadcrumbs for Element/VisualElement add too much overhead in some cases #2919
Comments
Hey @Redth , thanks for the feedback. I think this should be addressed in: |
@jamescrosswell thanks, this definitely will help! After the changes in that PR, I do think the BindElementEvents is still unnecessarily heavy and it would be great to be able to disable that category still too. |
Also, looking at the code here, it really should be updated to unsubscribe from most of the events that get wired up. The Application level, and maybe even the Window level ones aren't as much of an issue but the rest are going to cause memory leaks in MAUI apps. This is something we are actively working on reducing in .NET 8 / .NET 9, it would be awesome if you could help minimize this in your code base too :) |
Problem Statement
While doing some performance analysis of a MAUI app I've noticed on Android (and I expect iOS is also impacted, though I haven't looked closely there yet) that there's a fair bit of time spent adding breadcrumbs from the
MauiEventsBinder
wiring up various events.In this particular case it seems the
BindElementEvents
and/or theBindVisualElementEvents
are where most of the overhead comes from.I have a virtual list control which correctly updates recycled views within the visual tree, and this means binding context changes often as well as child add/removes often too for items in the list as you scroll. Given the scenario of a high performance scrolling list, I feel like breadcrumbs are not well suited to be added in these cases.
It would be great if there was a way to disable wiring up element/visual element events in some cases, or perhaps to limit the types of events that get bound in an app (eg: a setting to keep or not wire up categories individually - Application, Window, Page, Shell, Button events I'd like to keep, but Element, VisualElement, Reflected I'd prefer to disable entirely).
Solution Brainstorm
No response
The text was updated successfully, but these errors were encountered: