Closed Bug 1583651 Opened 6 years ago Closed 5 years ago

Clean up and simplify the AsyncTabSwitcher

Categories

(Firefox :: Tabbed Browser, task, P3)

task

Tracking

()

RESOLVED FIXED

People

(Reporter: alexical, Assigned: alexical)

Details

Attachments

(3 files)

I think this is something we can do iteratively. But I have a few ideas off the bat for making things just a little easier to reason about. This might help with the Q4 goal of understanding how the AsyncTabSwitcher will be interacting with Fission, performance-wise.

Ideas:

  • Send everything through one handleEvent function, so we don't have multiple call-sites for pre/postActions, and reentrancy is easier to reason about.
  • Pull out all of the telemetry logic into a separate class, as it's mostly inlined and some of the telemetry stuff can take as many as 17 lines of code.
  • Investigate pulling out the handling of non-remote browsers into an entirely separate code path so we don't clutter the AsyncTabSwitcher so much with isRemoteBrowser checks

This way we ensure that the reentrancy guard always stays in effect.
It should just be a little easier to reason about everything if it's
all channeled through the same place.

This just pulls chunks of TelemetryStopwatch and similar code,
which often eats up several lines, into some helper functions.
This should just help reduce the cognitive load of reading this
code.

Depends on D47349

This is just sometimes relevant for debugging things.

Depends on D47350

Along with these patches, with bug 1582042 landing, I wonder if we should pull out the LRU cache stuff for now, since it's basically dead code paths?

Keywords: leave-open
Pushed by dothayer@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/825800449ce7 Send all pre/postActions through handleEvent r=mconley https://hg.mozilla.org/integration/autoland/rev/b327dfd5a150 Pull Telemetry code out into helpers r=mconley https://hg.mozilla.org/integration/autoland/rev/7c836a6bf4e8 Add logging indicator for maybeVisibleTabs r=mconley

The leave-open keyword is there and there is no activity for 6 months.
:dthayer, maybe it's time to close this bug?

Flags: needinfo?(dothayer)

I suppose so - I think there's more cleanup that could be done but I don't think I'm going to get to it any time soon.

Status: NEW → RESOLVED
Closed: 5 years ago
Flags: needinfo?(dothayer)
Keywords: leave-open
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: