Skip to content

Skip useless handler mappings calls while connecting#27259

Merged
PureWeen merged 5 commits intodotnet:inflight/currentfrom
albyrock87:skip-useless-initial-handler-mappings-calls
Jun 27, 2025
Merged

Skip useless handler mappings calls while connecting#27259
PureWeen merged 5 commits intodotnet:inflight/currentfrom
albyrock87:skip-useless-initial-handler-mappings-calls

Conversation

@albyrock87
Copy link
Copy Markdown
Contributor

@albyrock87 albyrock87 commented Jan 21, 2025

Description of Change

This is an alternative initial version of #27042.
Everything has already been explained there.

Based on/includes #28077 PR

Credits to @MartyIX to have explored the effectiveness of skipping specific mappers.

Key differences from the other PR:

  • Avoid pre-mapping defaults: if the developer replaced the mapper and we skip execution, we're also skipping their custom code which would bring them wonder why their code it's not working while it should be
  • Adds easy-to-use extension methods to IElement and IElementHandler to get the handler state
  • We can selectively skip native calls close to them and by platform (for example on iOS MappingFrame takes care of all the coordinates, even translations, while on other platforms the situation is different)

Benchmark using Nalu Weather app

https://github.com/nalu-development/nalu/tree/main/Samples/Nalu.Maui.Weather

Click on the links in the table to download the speedscope.json file.

Platform SetVirtualView (SR4) SetVirtualView (PR) Improvement
iOS 411.99ms 233.62ms 43%
Android 340.62ms 299.34ms 12%
Windows 1.94s 1.50s 22%

Thanks to @MartyIX for collecting speedscopes on Windows!

Benchmark (from CI - on iOS UI tests)

Note: there is some variability in the benchmark caused by the runner itself, but looking at many recent PRs, main branch never goes under 2600ms.

main branch

image

#27042 original PR

image

this PR
image

Issues Fixed

Fixes #17303

Loading
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-core-platform Integration with platforms community ✨ Community Contribution

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[performance] all PropertyMapper's set the same values over and over