Improve iOS Label performance#30864
Closed
albyrock87 wants to merge 1 commit into
Closed
Conversation
Member
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
jsuarezruiz
reviewed
Jul 28, 2025
| if (!handler.IsConnectingHandler()) | ||
| { | ||
| // Any text update requires that we update any attributed string formatting | ||
| MapFormatting(handler, label); |
Contributor
There was a problem hiding this comment.
Did you check also if is invoked more than once?
We could review and could be a good optimization.
Contributor
Author
There was a problem hiding this comment.
@jsuarezruiz indeed, it was also mapping the text twice!
Also thanks a lot to @bhavanesh2001 for pointing out how LabelHandler.iOS is never called due to the code in Label.Mapper.cs (same thing on Entry.Mapper.cs).
I will update the perf numbers in the PR description soon.
8bf87e2 to
1fcf8c2
Compare
albyrock87
commented
Jul 28, 2025
|
|
||
| public static void MapFormatting(IEntryHandler handler, IEntry entry) | ||
| { | ||
| handler.PlatformView?.UpdateMaxLength(entry); |
Contributor
Author
There was a problem hiding this comment.
This wasn't taking into consideration that a developer can provide their own mappers.
Member
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
PureWeen
requested changes
Aug 4, 2025
Comment on lines
+34
to
+38
| [nameof(IEntry.Font)] = MapFont, | ||
| [nameof(IEntry.MaxLength)] = MapMaxLength, | ||
| [nameof(IEntry.HorizontalTextAlignment)] = MapHorizontalTextAlignment, | ||
| [nameof(IEntry.VerticalTextAlignment)] = MapVerticalTextAlignment, | ||
| [nameof(IEntry.CharacterSpacing)] = MapCharacterSpacing, |
Member
There was a problem hiding this comment.
Chatted with @albyrock87
Fix this by adding a second mapper to enforce a more intentional ordering
1fcf8c2 to
a95b708
Compare
Member
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Member
|
/rebase |
a95b708 to
a5f3531
Compare
|
Azure Pipelines successfully started running 3 pipeline(s). |
Member
|
closing in favor of #31159 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
This PR contributes on improving what's reported in #30721 regarding iOS.
Labelis a fundamental component of all applications, and by looking at the provided speedscope I noticed thatMapTextwas taking a lot.The reason is (as usual) useless mapping calls.