[WinUI] Cache gesture event subscriptions
Description of Change
Interops operations on Windows are costly. This PR avoids unsubscribing events that were not subscribed in the first place and thus improving performance.
Speedscope
- Maui.Controls.Sample.Sandbox.exe_20240420_185714.speedscope.json - main
- Maui.Controls.Sample.Sandbox.exe_20240420_185847.speedscope.json - PR
-> 70% improvement for that particular method.
I test with my complex grid sample basically.
Issues Fixed
Contributes to #21787
Hey there @MartyIX! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.
@jonathanpeppers would you mind taking a look please?
Measurements with commit a5f8d56fb2fe4b820a41de4b01bcd3e91c6d591f addressing https://github.com/dotnet/maui/pull/21959#discussion_r1575352239 by adding SubscriptionFlags
- Maui.Controls.Sample.Sandbox.exe_20240423_100728.speedscope.json - master
- Maui.Controls.Sample.Sandbox.exe_20240423_100904.speedscope.json - PR
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
@rmarinho Could you take a look please?
@jfversluis Could you take a look please?
@Foda might be the right person here
@Foda Could you take a look please?
@rmarinho Is it good to be merged or does it need to wait until SR6?
@rmarinho Anything else to do here?