Closed Bug 1919688 Opened 2 years ago Closed 1 year ago

Add PerfStats in more places in a11y code

Categories

(Core :: Disability Access APIs, task)

task

Tracking

()

RESOLVED FIXED
137 Branch
Tracking Status
firefox137 --- fixed

People

(Reporter: Jamie, Assigned: morgan)

References

(Blocks 1 open bug)

Details

(Whiteboard: [a11yPerf24h2])

Attachments

(6 external files)

After discussion with the performance team, we've determined that PerfStats are likely to be the most helpful measurements in determining performance improvements/regressions in accessibility code. To that end, we want to add PerfStats in a bunch of additional places which are potential hot paths. To make diagnosis easier, all PerfStats should also have corresponding profile markers.

  • a11y::PlatformShowHideEvent: Firing show and hide events to the OS.
  • DocAccessible::ContentRemoved
  • DocAccessible::PruneOrInsertSubtree: Deciding whether to add or remove an Accessible when layout changes.
  • DocAccessible::ShutdownChildrenInSubtree
  • DocAccessibleChild::ShowEvent: Sending newly inserted Accessibles, including cache data.
  • DocAccessibleParent::RecvCache: Receiving cache updates.
  • DocAccessibleParent::RecvHideEvent: Processing removals from the RemoteAccessible tree.
  • DocAccessibleParent::RecvShowEvent: Processing insertions into the RemoteAccessible tree, including updating the cache.
  • EventQueue::CoalesceEvents
  • LocalAccessible::SendCache (already has a profiler marker)
  • NotificationController::CoalesceMutationEvents
  • NotificationController::WillRefresh (already has a profiler marker)
  • NotifyWinEvent: Firing events to Windows specifically.
  • nsAccessibilityService::Init (already has a profiler marker)
Whiteboard: [a11yPerf24h2]
Type: defect → task

Hi :bdekoz. I'm looking into adding these new PerfStats, but I just spotted that PerfStats has a MetricMask type which is a uint64_t. If I understand this correctly, that means we can only have 63 metrics in total with the current implementation. There are already 31 of them and this bug proposes adding 14 more. That's obviously still below the limit, but it does mean a11y would be disproportionately consuming slots in a limited pool. Should we be trying to narrow this list down further or is that a problem you/someone else is happy to deal with later?

Flags: needinfo?(bdekoz)

Hey, sorry about the delay here. It's great to see the scope of your ambition here. Is there any way you can prioritize this into a group 1, group 2? Or are all of these the same priority in terms of data needs? I don't think that 14 new flags is necessarily a deal breaker, but it would be great to be able to stage this in multiple bites.

I'm currently working on getting metadata about a11y use into another ping, the performance page load event. Can this wait until that is done?

Flags: needinfo?(bdekoz)
Assignee: nobody → bdekoz

(In reply to Benjamin De Kosnik [:bdekoz] from comment #2)

Is there any way you can prioritize this into a group 1, group 2?

Here's an initial attempt to split these into priority buckets:

  • High priority:
    • DocAccessible::ContentRemoved
    • DocAccessible::PruneOrInsertSubtree: Deciding whether to add or remove an Accessible when layout changes.
    • DocAccessible::ShutdownChildrenInSubtree
    • DocAccessibleChild::ShowEvent: Sending newly inserted Accessibles, including cache data.
    • DocAccessibleParent::RecvCache: Receiving cache updates.
    • DocAccessibleParent::RecvShowEvent: Processing insertions into the RemoteAccessible tree, including updating the cache.
    • EventQueue::CoalesceEvents
    • NotificationController::CoalesceMutationEvents
  • Medium priority:
    • DocAccessibleParent::RecvHideEvent: Processing removals from the RemoteAccessible tree.
    • LocalAccessible::SendCache (already has a profiler marker)
    • NotificationController::WillRefresh (already has a profiler marker)
      • Most of the problems we might see here should be caught by other metrics we already have or high priority new metrics listed above; i.e. those other hot paths are all wrapped inside WillRefresh.
  • Low priority:
    • a11y::PlatformShowHideEvent: Firing show and hide events to the OS.
    • NotifyWinEvent: Firing events to Windows specifically.
    • nsAccessibilityService::Init (already has a profiler marker)

Morgan, on a brief look, what do you think about the buckets here? Do you think we can move more out of high priority? I was thinking of moving DocAccessible::ShutdownChildrenInSubtree out, but we have at least one bug where we think this is causing problems and we have no other way of measuring it right now, so I'm a bit reluctant to move it out.

I'm currently working on getting metadata about a11y use into another ping, the performance page load event. Can this wait until that is done?

Yes. There's no urgency here; we'd just like to keep the momentum going so we do have a good a11y perf metrics story in the not too distant future.

Flags: needinfo?(mreschenberg)

(In reply to James Teh [:Jamie] from comment #3)

(In reply to Benjamin De Kosnik [:bdekoz] from comment #2)

Is there any way you can prioritize this into a group 1, group 2?

Here's an initial attempt to split these into priority buckets:
...
Morgan, on a brief look, what do you think about the buckets here? Do you think we can move more out of high priority? I was thinking of moving DocAccessible::ShutdownChildrenInSubtree out, but we have at least one bug where we think this is causing problems and we have no other way of measuring it right now, so I'm a bit reluctant to move it out.

I think these look good -- we ended up discussing this briefly on a zoom call :)

:bdekoz -- can you say more about what the page load ping would get us / what work is involved there?

Flags: needinfo?(mreschenberg)
Flags: needinfo?(bdekoz)

sorry, this was discussed in person and I'm now circling back. I think this plan is the right form, we can do this in the manner specified. I'm no longer insisting on or even suggesting smaller bites or staging this, although it was useful to see what you are thinking in terms of prioritization. For visualizing results, and getting results from CI, perfstats will work great and so we should concentrate on that for now. Once we have more experience we can think about expanding out and getting telemetry/RUM in the exact same fashion when we know lab results look good.

page load ping is more about trying to get metadata that is useful for a11y into telemetry results, into bigquery tables, like what AT are active in a given pageloads, or in a given set of 30 page loads. That would be for giving a11y a handle on analyzing telemetry, where partitions could be selected such as

this population has a AT device enabled

or

this population has no AT enabled

or

this population has a screen reader enabled.

Those kinds of segments. That's a separable task, so let's concentrate on the metrics in this bug, getting measurements from CI, getting reproducible performance results with these metrics. The data analysis/telemetry parts can go here: https://bugzilla.mozilla.org/show_bug.cgi?id=1932691

Flags: needinfo?(bdekoz)
Attachment #9464773 - Attachment description: Bug 1919688: Add perfstats markers for ContentRemoved functions r?bdekoz,denispal → Bug 1919688: Add perfstats markers for ContentRemoved functions r?bdekoz
Attachment #9464773 - Attachment description: Bug 1919688: Add perfstats markers for ContentRemoved functions r?bdekoz → Bug 1919688: Add perfstats markers for high priority DocAccessible functions r?bdekoz

:Jamie do you think its worth adding a marker for RecvMutationEvents? I migrated the two RecvShow/HideEvent markers to the newly named ProcessShow/HideEvent functions, but I'm wondering if we should add a marker for this new function too.

Pushed by mreschenberg@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d0959ee85725 Expand Metric enum to uint64_t from uint32_t r=denispal https://hg.mozilla.org/integration/autoland/rev/adaca3ddb615 Add perfstats markers for high priority DocAccessible functions r=bdekoz https://hg.mozilla.org/integration/autoland/rev/c7209fc76943 Add perfstats marker for DocAccessibleChild::ShowEvent r=bdekoz https://hg.mozilla.org/integration/autoland/rev/478c0496cae7 Add perfstats markers for high priority DocAccessibleParent functions r=bdekoz https://hg.mozilla.org/integration/autoland/rev/6588d87b15a0 Add perfstats marker for EventQueue::CoalesceEvents funciton r=bdekoz https://hg.mozilla.org/integration/autoland/rev/8242e03983b7 Add perfstats marker for NotificationController::CoalesceMutationEvents funciton r=bdekoz
Blocks: 1950235
Assignee: bdekoz → mreschenberg
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: