Improve performance of the accessibility highlighter.
Categories
(DevTools :: Accessibility Tools, enhancement)
Tracking
(firefox66 fixed)
| Tracking | Status | |
|---|---|---|
| firefox66 | --- | fixed |
People
(Reporter: yzen, Assigned: yzen)
References
Details
Attachments
(3 files)
| Assignee | ||
Comment 1•6 years ago
|
||
| Assignee | ||
Comment 2•6 years ago
|
||
| Assignee | ||
Comment 3•6 years ago
|
||
| Assignee | ||
Comment 4•6 years ago
|
||
Updated•6 years ago
|
Updated•6 years ago
|
| Assignee | ||
Comment 5•6 years ago
|
||
(In reply to Yura Zenevich [:yzen] from comment #1)
Created attachment 9032724 [details]
Bug 1514856 - make sure a11y highlighter does not do unnecessary when
highlighted accessible gets updated. r=pbroMozReview-Commit-ID: AhfECIMsDPm
Here are 2 profiles performing the traversal of the whole a11y tree in the panel twice (top to bottom and bottom to top):
Before: https://perfht.ml/2VWoDjb (traversal happens between ~6s and 10.5s)
After: https://perfht.ml/2VTxqT0 (traversal happens between 5s and 10s)
You can see jank (2 red markers) in the before profile. If you look at just those intervals (just zoom in bound by the jank), and reverse the call stack, you will see that most of that time is spent on calculating the RGBA values (min,max) for backgrounds. This jank is not present in the second profile because this patch prevents highlighting for accessible objects that are no longer considered "current".
| Assignee | ||
Comment 6•6 years ago
|
||
(In reply to Yura Zenevich [:yzen] from comment #2)
Created attachment 9032725 [details]
Bug 1514856 - move image data array traversal to worker thread when
calculating contrast ratio for text nodes. r=jdescottes, ochameauMozReview-Commit-ID: K3twiMih7e9
Depends on D15112
Regarding the second patch, this is the best 2 profiles I could manage:
Before: https://perfht.ml/2QR6nEq
After: https://perfht.ml/2QQFX5w
They both describe the same action - highlighting of a fairly large text node. The noticeable difference is the much longer jank in the content process (server side). The the biggest contrast computation step runs in the worker (see "after"). There is still some jank due to image data generation that still happens on the main thread in content in both cases and in the future could potentially move into offscreen canvas if it ever supports 2D.
| Assignee | ||
Comment 7•6 years ago
|
||
(In reply to Yura Zenevich [:yzen] from comment #3)
Created attachment 9032726 [details]
Bug 1514856 - scale the text node snapshots down to normal size when text is
too big or is zoomed in. r=pbroMozReview-Commit-ID: IzRo5nA94Fd
Depends on D15113
The latest profile: https://perfht.ml/2QRChAm has no jank visible with the "after" profile from comment 6.
Updated•6 years ago
|
Updated•6 years ago
|
Comment 8•6 years ago
|
||
Thanks a lot Yura for these reports, they are all perfect!
With such details, I'm highly confident that each individual patch is having the expected positive impact on performance.
Now, if you want to go further and ensure this work won't regress, you can contribute to DAMP to cover the accessibility panel and the few interactions you care about.
Updated•6 years ago
|
Comment 10•6 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/ee36ea46016d
https://hg.mozilla.org/mozilla-central/rev/4fe5d0b72572
https://hg.mozilla.org/mozilla-central/rev/50582093318a
Description
•