Closed Bug 1938958 Opened 1 year ago Closed 1 year ago

15 - 5.27% a11yr / a11yr + 2 more (Linux, OSX) regression on Wed December 18 2024

Categories

(Core :: Disability Access APIs, defect)

defect

Tracking

()

RESOLVED FIXED
137 Branch
Tracking Status
firefox-esr128 --- unaffected
firefox133 --- unaffected
firefox134 --- unaffected
firefox135 --- wontfix
firefox136 --- wontfix
firefox137 --- fixed

People

(Reporter: intermittent-bug-filer, Assigned: nlapre)

References

(Regression)

Details

(4 keywords)

Attachments

(1 external file)

Perfherder has detected a talos performance regression from push 491e0211fbbf904c07a30eea361b0e4e26eeb595. As author of one of the patches included in that push, we need your help to address this regression.

Regressions:

Ratio Test Platform Options Absolute values (old vs new)
15% a11yr linux1804-64-shippable-qr e10s fission stylo webrender-sw 557.97 -> 641.68
14% a11yr linux1804-64-shippable-qr e10s fission stylo webrender 564.83 -> 642.93
6% a11yr macosx1470-64-shippable e10s fission stylo webrender-sw 370.25 -> 391.13
5% a11yr macosx1470-64-shippable e10s fission stylo webrender 372.76 -> 392.40

Details of the alert can be found in the alert summary, including links to graphs and comparisons for each of the affected tests. Please follow our guide to handling regression bugs and let us know your plans within 3 business days, or the patch(es) may be backed out in accordance with our regression policy.

If you need the profiling jobs you can trigger them yourself from treeherder job view or ask a sheriff to do that for you.

You can run all of these tests on try with ./mach try perf --alert 43177

The following documentation link provides more information about this command.

For more information on performance sheriffing please see our FAQ.

If you have any questions, please do not hesitate to reach out to aglavic@mozilla.com.

Flags: needinfo?(nlapre)

Set release status flags based on info from the regressing bug 1774918

It has been over 7 days with no activity on this performance regression.

:nlapre, since you are the author of the regressor, bug 1774918, which triggered this performance alert, could you please provide a progress update?

If this regression is something that fixes a bug, changes the baseline of the regression metrics, or otherwise will not be fixed, please consider closing it as WONTFIX. See this documentation for more information on how to handle regressions.

For additional information/help, please needinfo the performance sheriff who filed this alert (they can be found in comment #0), or reach out in #perftest, or #perfsheriffs on Element.

For more information, please visit BugBot documentation.

Flags: needinfo?(nlapre)

Just back from winter vacation, looking at this now. It definitely looks like my changes that amalgamate mutation events have caused issues in these specific performance tests, even though they significantly improve performance for other issues (many mutation events happening at once). There might be some inherent overhead in the new approach that degrades our performance in these Talos tests. I'm waiting for Treeherder to generate performance profiles so I can analyze the difference. Hopefully I can find and remove that overhead. If all else fails, this may have to be our new baseline, since the issue that the patch addressed was quite significant. Will update here when I find out more.

Flags: needinfo?(nlapre)

Here's a before and here's an after profile of linux1804-64-shippable-qr. The test code is here. The test case is >99% show events, my rough estimate is 50,000 accessible nodes.

The difference is pretty clear to me comparing them visually. Before, the content process would send incremental mutation events on load (only partially batching). The parent process could do some processing work while the content process is only partway through building events. After, content builds up all of the mutation events and send them in one big chunk. The parent process is idle until content has finished building its big event batch. Despite wins in content process time (down ~10%) and IPC overhead, we've effectively serialized the content and parent process for these page load scenarios.

I think it's safe to say that we want to keep the performance wins for fast-mutating pages that the original patch fixed, but not at the expense of load time. To me, these profiles suggest some happy medium where we choose smaller batches in order to give the parent process something to chew on before content is done creating events, while also keeping the batch size large enough to handle those fast-mutating pages without choking the entire browser. I think I'll try numbers in the one to five thousand range and profile the same test case again.

It's possible that the ultimate solution will require dynamically modifying the batch size based on some heuristics, but I don't want to have to go there yet if just choosing a better constant batch size can help.

Set release status flags based on info from the regressing bug 1774918

A few things I've found while researching this:

  • There is a discrepancy, before the regressing patch, between the behavior of DoInitialUpdate and a non-initial-update ProcessMutationEvents. Taking the dhtml.html test example, the JS that builds the page (adding elements) may have run before DoInitialUpdate runs, or it may not. It's not deterministic. If the JS runs first, DoInitialUpdate will coalesce all children of the role="application" accessible into one big show event. If not, each individual added element will be its own show event. This seems to account for some variance in the test timings, though it does not reduce the statistical significance of the timing regression. The regressing patch doesn't appear to have pushed us towards one scenario over another; they both occur before and after the patch. An interesting note is that this patch does make the behavior consistent between these scenarios; we'll always amalgamate mutation events be it an initial push or not.
  • Per the info above, I would expect the pre-patch DoInitialUpdate amalgamated show event case to be roughly equivalent to the post-patch runs. It's not, and I'm not sure why.
  • Total content process time spent in accessibility is down with the regressing patch (between 5-10% of traced run time in profiles), and total parent process time is unchanged or slightly down, but whatever time the test is measuring is up. Comparing profiles, it's hard to tell whether the actual clock time for the page to be responsive is meaningfully different. It might be, but it doesn't seem to be 15%, or as dramatic as it looks on Perfherder. I would like to know precisely what the test measures.
  • Reducing the batch size appears to be a slight win for these test cases. I am still searching for the optimal number. 2500 accessible nodes per batch, for instance, gets us down to a ~7% regression on dhtml.html. I think picking any number is going to be a bit difficult since there are so many use cases we might hit.
  • Tuning the batch size is one worthwhile lever to pull, but to actually address the issue of underusing the parent process, we also have to send batches more often. That means, every time we hit kMaxAccsPerMessage we should actually send the IPC message. I am prototyping this now.

Tuning the batch size is one worthwhile lever to pull, but to actually address the issue of underusing the parent process, we also have to send batches more often. That means, every time we hit kMaxAccsPerMessage we should actually send the IPC message. I am prototyping this now.

After many PerfCompare runs, it looks like sending smaller batches more often makes a big difference. I've tried two variables: (1) kMaxAccsPerMessage, the max number of Accessibles touched before we mark a batch, and (2) kMinBatches, a new thing I've introduced that controls how many batches we can build up before sending our built-up batches over IPC. When appending new mutation events, my test code will check whether we've met or exceeded kMinBatches and send the pending batches immediately. This gives the parent process something to chew on while the child process continues to batch up more mutation events, without sending one IPC message per mutation event.

Right now, the best results I've gotten from the PerfHerder machines are from kMaxAccsPerMessage of 1000 and kMinBatches of 3 and 5. The number of runs is still low, but it's looking good. For instance, examine this PerfHerder comparison between current central and a test branch that uses kMaxAccsPerMessage of 1000 and kMinBatches of 3. PerfHerder reports high confidence of a -22.62% time change for one configuration, with similar numbers across the board. To me, this seems very promising. It looks like, with some small tweaks, we can erase the regression identified in this bug and push performance past the previous baseline. I'm going to keep testing for higher confidence and polish this into a reviewable patch. With any luck, these changes will improve performance for both initial load and fast-mutating pages.

It has been over 7 days with no activity on this performance regression.

:nlapre, since you are the author of the regressor, bug 1774918, which triggered this performance alert, could you please provide a progress update?

If this regression is something that fixes a bug, changes the baseline of the regression metrics, or otherwise will not be fixed, please consider closing it as WONTFIX. See this documentation for more information on how to handle regressions.

For additional information/help, please needinfo the performance sheriff who filed this alert (they can be found in comment #0), or reach out in #perftest, or #perfsheriffs on Element.

For more information, please visit BugBot documentation.

Flags: needinfo?(nlapre)

This revision modifies AppendMutationEventData such that it can actually send
mutation event batches over IPC. Previously, we were waiting for massive batches
of mutation events before sending, which leaves the parent process with little
to do until it receives one big message. While more efficient from the content
and parent process' perspective individually, the overall load time of pages
suffered from having such large batch sizes sent after all mutation events have
been calculated. The overall page load time benefits from having both content
and parent processes execute accessibility-related tree building code in
parallel, even though there is some inefficiency associated with interrupting
tree-building to serialize, send, and receive an IPC message more often.

To that effect, this revision introduces the concept of kMinBatches, which
controls the number of batches that we may build up in the content process
before we send an IPC message. Talos testing with various combinations of
numbers reveals that 3 batches of 1000 Accessibles per send, sent while building
mutation events, garners us big performance wins for page load and heavy
mutation. This reverses a previous timing regression, and improves on the
pre-regression baseline.

Assignee: nobody → nlapre
Status: NEW → ASSIGNED
Flags: needinfo?(nlapre)
Attachment #9461671 - Attachment description: Bug 1938958: Set kMaxAccsPerMessage to 1000, sent once we have 3 batches, r?jamie → Bug 1938958: Set kMaxAccsPerMessage to 1000, send once one batch is full, r?jamie
Pushed by nlapre@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5008d61f9f30 Set kMaxAccsPerMessage to 1000, send once one batch is full, r=Jamie
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 137 Branch

The patch landed in nightly and beta is affected.
:nlapre, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox136 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(nlapre)
Flags: needinfo?(nlapre)

(In reply to Pulsebot from comment #10)

Pushed by nlapre@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5008d61f9f30
Set kMaxAccsPerMessage to 1000, send once one batch is full, r=Jamie

Perfherder has detected a talos performance change from push 5008d61f9f30743f0d912efd16ff76fcdd5d8871.

Improvements:

Ratio Test Platform Options Absolute values (old vs new)
17% a11yr linux1804-64-shippable-qr e10s fission stylo webrender 642.34 -> 536.37
16% a11yr windows11-64-shippable-qr e10s fission stylo webrender 196.19 -> 164.47
16% a11yr linux1804-64-shippable-qr e10s fission stylo webrender-sw 640.13 -> 536.77
16% a11yr macosx1470-64-shippable e10s fission stylo webrender-sw 396.93 -> 332.82
15% a11yr windows11-64-shippable-qr e10s fission stylo webrender-sw 194.13 -> 164.15
11% a11yr macosx1470-64-shippable e10s fission stylo webrender 392.68 -> 350.05

Details of the alert can be found in the alert summary, including links to graphs and comparisons for each of the affected tests.

If you need the profiling jobs you can trigger them yourself from treeherder job view or ask a sheriff to do that for you.

You can run these tests on try with ./mach try perf --alert 43768

For more information on performance sheriffing please see our FAQ.

See Also: → 2038469
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: