Draft
Conversation
j-piasecki
previously approved these changes
Nov 6, 2024
Collaborator
j-piasecki
left a comment
There was a problem hiding this comment.
The code looks good but what's the reasoning behind this change?
Collaborator
Author
|
There's no particular reason for this change right now. Android spans are known to be slow and I want to see if we can make it faster by eliminating |
Collaborator
Author
|
I've tested out this change on Google Pixel 4 in release mode with profiler attached and So there's no rush to get this PR merged as the performance is comparable. |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Details
This PR changes the way how spans are removed before applying new formatting.
Previously, we would call
ssb.getSpans(0, ssb.length(), MarkdownSpan.class)to find all span added in the previous run. All added spans implementMarkdownSpaninterface.After this change, each time we add a span, we add it to
mMarkdownSpanslist (ArrayList). Then, we iterate over that list to remove all previously added spans and clear the list afterwards.Related Issues
GH_LINK
Manual Tests
Linked PRs