Closed Bug 1716557 Opened 5 years ago Closed 4 years ago

Browser becomes unresponsive during downloads due to animation

Categories

(Firefox :: Downloads Panel, defect, P3)

Firefox 89
defect

Tracking

()

RESOLVED DUPLICATE of bug 1578123

People

(Reporter: kingofthe, Unassigned)

Details

(Keywords: perf, Whiteboard: [fxperf:p3][QA-not-reproducible])

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0

Steps to reproduce:

I have some 45-55 windows open and with each new window it seems downloads are affecting performance more and more to the point where a download will make the browser controls unresponsive.

This has only started after I updated to Windows 10. Downloads do seem to sometimes activate Windows memory compression but not always.

Actual results:

The browser basically freezes and becomes nigh-unresponsive for the duration of all downloads, small and large. No other application that is used for downloading on my system does this and Firefox never did either on Windows 7.

The behavior has been getting worse the more windows I have open (closing them is not an option right now) and I believe the performance regression has to do with the download meter animations and/or updating each window since the freezing gets worse the more windows are open.

Expected results:

Firefox should download files without becoming unresponsive for the duration of the file download.

The Bugbug bot thinks this bug should belong to the 'Firefox::Downloads Panel' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Downloads Panel

Hey KotW,
Can you please capture a performance profile using the FIrefox Profiler ? You can find it here: https://profiler.firefox.com/

Flags: needinfo?(kingofthe)

I did a performance profile during a short download. Both the profiler and the download completely hitch the browser, by the way!

Flags: needinfo?(kingofthe)

This is probably a duplicate, but I couldn't find the original bug.
The profile for the single window doesn't seem to indicate particularly bad behaviors off-hand.
The problem is likely caused by us showing the download animation and updating progress in all the windows, instead of just the foreground one.

Severity: -- → S3
Keywords: perf
Priority: -- → P3
Whiteboard: [fxperf]

I think this is the relevant part of the profile: https://share.firefox.dev/3hCBJhh

We play the downloadsButtonNotification CSS animation 50 times. The stack that seems to start the animation is:

(root)
XREMain::XRE_main
promise callback
js::RunScript
AsyncFunctionNext [self-hosted:695:26]
js::RunScript
InterpretGeneratorResume [self-hosted:1485:33]
add [resource://gre/modules/DownloadList.jsm:284:5]
DL_add [resource://gre/modules/DownloadList.jsm:61:22]
_notifyAllViews [resource://gre/modules/DownloadList.jsm:183:17]
js::RunScript
onDownloadAdded [resource:///modules/DownloadsCommon.jsm:1375:17]
_updateViews [resource:///modules/DownloadsCommon.jsm:1330:14]
forEach [self-hosted:208:21]
_updateView [resource:///modules/DownloadsCommon.jsm:1465:13]
js::RunScript
set percentComplete [chrome://browser/content/downloads/indicator.js:464:21]
showEventNotification [chrome://browser/content/downloads/indicator.js:366:23]
_showNotification [chrome://browser/content/downloads/indicator.js:393:19]
Element.setAttribute

I wonder how much effort it would be to skip the animation for windows that are in the background.

Whiteboard: [fxperf] → [fxperf:p3]
Whiteboard: [fxperf:p3] → [fxperf:p3][QA-not-reproducible]

Just to add I've got more windows and tabs open now and the effect is definitely getting progressively worse. I'm using the dark theme, by the way, though I did also just test the issue with a light theme with no discernible difference.

I'm to the point where I can no longer download anything if I want to use the browser. Almost nothing with the UI works while I download.

So in addition to the animation, it's also using lots of memory?

Flags: needinfo?(kingofthe)
Summary: Browser becomes unresponsive during downloads → Browser becomes unresponsive during downloads due to animation

Clear a needinfo that is pending on an inactive user.

For more information, please visit auto_nag documentation.

Flags: needinfo?(kingofthe)

Bug 1578123 proposes throttling the refresh driver for background windows, that would solve the issue discussed here.

Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: