Closed Bug 1975272 Opened 7 months ago Closed 1 month ago

Animated newtab background images consume CPU even when not in the foreground

Categories

(Firefox :: New Tab Page, defect)

defect

Tracking

()

RESOLVED FIXED
149 Branch
Performance Impact ?
Tracking Status
firefox149 --- fixed

People

(Reporter: mconley, Assigned: mconley, NeedInfo)

References

Details

Attachments

(1 file)

STR:

  1. Download this GIF image: https://drive.google.com/file/d/1xvEHMjUX77D5wfEt3Ppjtb10iksP5Jxe/view?usp=sharing
  2. In a new profile, set that image as the custom background
  3. Open several new tabs
  4. Visit about:processes, and look at the CPU usage of "About pages"

ER:

When newtab is backgrounded, we should try to avoid consuming any CPU except to prepare the next newtab opening.

AR:

It appears that the images that are animating are still causing the CPU to be consumed.

We might be able to easily solve this by setting the imageAnimationMode on the document to kDontAnimMode when in the background, and then set it to kNormalAnimMode when foregrounded.

Performance Impact: --- → ?

This is fairly speculative, but certainly seems to drop the CPU usage way down when I have many tabs open.

This doesn't cover the preloaded newtab case, since that newtab thinks it is visible. If that is something we also want to solve, we may have reached the point where we accept the patch in bug 1548683, which makes the preloaded newtab not think it is visible.

Why is it that the refresh driver doesn't know that the document is background and so throttles the ticking?

The severity field is not set for this bug.
:thecount, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(sdowne)
See Also: → 1976603
See Also: → 1548683

See also bug 1972210

Assignee: nobody → mconley
Attachment #9498206 - Attachment description: WIP: Bug 1975272 - Stop animations on newtab unless foregrounded. → Bug 1975272 - Stop animations on newtab unless foregrounded. r?#home-newtab-reviewers!
Status: NEW → ASSIGNED
See Also: → 1972210
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 149 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: