Skip to content

[AttributedText] Improve performance of getAttributionSpansInRange#3010

Merged
matthew-carroll merged 6 commits into
Flutter-Bounty-Hunters:mainfrom
knopp:fix_get_attribution_span_in_range
May 7, 2026
Merged

[AttributedText] Improve performance of getAttributionSpansInRange#3010
matthew-carroll merged 6 commits into
Flutter-Bounty-Hunters:mainfrom
knopp:fix_get_attribution_span_in_range

Conversation

@knopp

@knopp knopp commented May 7, 2026

Copy link
Copy Markdown
Contributor

AttributedSpans.getAttributionSpansInRange frequently appears in a hot codepath and current implementation seems to have cubic complexity. This PR replaces it with simpler implementation that only traverses the attributes once.

@knopp

knopp commented May 7, 2026

Copy link
Copy Markdown
Contributor Author

The updated test originally seemed to rely on ordering within the set which doesn't seem like behavior that we should depend on.

@knopp

This comment was marked as outdated.

@knopp knopp force-pushed the fix_get_attribution_span_in_range branch from ba8ff0d to 840b139 Compare May 7, 2026 14:29
Refactor attribution span matching logic for clarity.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants