Repository navigation
Avoid quadratic autolinking on pages with many links - #22319
Conversation
Viewer preview🗑️ Viewer previews removed. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #22319 +/- ##
==========================================
- Coverage 90.47% 90.46% -0.01%
==========================================
Files 277 277
Lines 68313 68317 +4
==========================================
+ Hits 61803 61804 +1
- Misses 6510 6513 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merging this PR will degrade performance by 1.75%
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
Snuffleupagus
left a comment
There was a problem hiding this comment.
Also, please add the description in #22319 (comment) to the (first) commit message.
r=me, thanks.
| annotationType: AnnotationType.LINK, | ||
| rotation: 0, | ||
| ...calculateLinkPosition(range, pdfPageView), | ||
| // Assigned by AnnotationLayer after overlap filtering. |
There was a problem hiding this comment.
This is slightly less clear than the old comment, can we please just keep that one instead?
| // Assigned by AnnotationLayer after overlap filtering. | |
| // Populated in the annotationLayer to avoid unnecessary object creation, | |
| // since most inferred links overlap existing LinkAnnotations: |
The comment was reworded in #22319, but the original wording is clearer.
Autolinker.processLinkswas quadratic in the number of links on a page:Rangeper link. In Firefox, each attribute write costs time proportional to the number of live ranges, so the annotation layer'saria-ownsupdates became quadratic;_convertMatchesonce per link, and each call rescanned the text items from the start.