Closed Bug 1848633 Opened 3 years ago Closed 3 years ago

Limit history item pref to 300

Categories

(Firefox :: Firefox View, task, P1)

task

Tracking

()

VERIFIED FIXED
119 Branch
Tracking Status
firefox119 --- verified

People

(Reporter: jsudiaman, Assigned: jsudiaman)

References

Details

(Whiteboard: [fidefe-firefox-view])

Attachments

(1 file)

If the browser.firefox-view.max-history-rows pref is set to a high number (>= 2000), or disabled entirely (-1), then loading History invariably causes the browser to hang. Profiling shows that the Lit method scheduleUpdate() can take up to a half second to complete, and there are many such calls being fired in quick succession.

To prevent this, we should delay loading the rows that are further down the list. Lit does allow us to control the timing of updates by overriding this method. As a quick and dirty example, I added this function to FxviewTabRow:

async scheduleUpdate() {
  await new Promise(resolve =>
    Services.tm.idleDispatchToMainThread(() => resolve())
  );
  super.scheduleUpdate();
}

This comes with the obvious caveat that there will be a bunch of blank rows if the user decides to scroll immediately upon switching to History before it is “fully loaded”. But it is definitely preferable to locking up the browser.

Status: NEW → ASSIGNED
Pushed by jsudiaman@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/658a7ab8591f Prevent browser lockup when loading too many history entries r=kcochrane,fxview-reviewers
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 119 Branch
Summary: Prevent browser lockup when loading too many history entries → Limit history item pref to 300

For clarity, we landed this patch with the max history entries pref to 300 based on QA feedback (and not the idea Jonathan was investigating in comment 0) since it was determined that the implementation would be buggy and that the real fix will be virtualization, which Kelly can focus on after we wrap up remaining requirements for 119.

Flags: qe-verify+
QA Contact: gasofie

Verified as fixed Firefox 120.0a1 and Firefox 119.0b9 Windows 10x64, macOS 13 and Ubuntu 18.4

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: