Hidden CSS background gif (completely covered by opaque child <img>) activates the refresh driver

NEW
Unassigned

Status

()

Core
CSS Parsing and Computation
4 years ago
4 months ago

People

(Reporter: rvitillo, Unassigned)

Tracking

({power})

Trunk
x86
All
power
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [Power:P3])

Attachments

(2 attachments)

Created attachment 8370665 [details]
Power consumption on Linux

Firefox is consuming an excessive amount of CPU resources while idling on Microsoft.com compared to Chrome.
(Reporter)

Comment 1

4 years ago
Created attachment 8370847 [details]
testcase 1

Even though a background gif is hidden by a static image in the testcase it still activates the refresh driver.
Flags: needinfo?(bgirard)
(Reporter)

Updated

4 years ago
Summary: High power consumption on Microsoft.com while idling → Hidden background gif activates the refresh driver
(Reporter)

Updated

4 years ago
Component: General → CSS Parsing and Computation
Product: Firefox → Core
Hmm.  The animation state of an unpainted image is not observable, I believe.  So we could try to optimize this away as long as we can prove it's not painted...
(Reporter)

Updated

4 years ago
Flags: needinfo?(bgirard)
Finding out if this image is invisible is very difficult based from the testcase to do this in general.

Roberto can you dig into and see if other browsers are going into sleep or are more efficient at skipping the frame when they wake up?
Component: CSS Parsing and Computation → Graphics
(Reporter)

Comment 4

4 years ago
Chrome has a low number of wakeups (<10) compared to FF.
[clarifying summary]
Summary: Hidden background gif activates the refresh driver → Hidden CSS background gif of <img src=[opaque image]> activates the refresh driver
Ah, this is a background?  Its animation state is _definitely_ not observable if we can prove the padding is 0, the border is 0 or opaque, and the content is opaque and covers the content area...
(In reply to Boris Zbarsky [:bz] from comment #6)
> Ah, this is a background?  Its animation state is _definitely_ not
> observable if we can prove the padding is 0, the border is 0 or opaque, and
> the content is opaque and covers the content area...

The background in the testcase is on the parent element from the img (the thing that is opaque), not the img itself.
Oh, was confused by the new summary.

Still, for a background visual occlusion should be enough to stop ticking the animation on it.

One caveat is that if it becomes visible again you have to run catchup on it or something, perhaps.
(In reply to Timothy Nikkel (:tn) from comment #7)
> The background in the testcase is on the parent element from the img

Ah, sorry; I misread the testcase. --> correcting summary
Summary: Hidden CSS background gif of <img src=[opaque image]> activates the refresh driver → Hidden CSS background gif (completely covered by opaque child <img>) activates the refresh driver
(Reporter)

Updated

4 years ago
Duplicate of this bug: 971018
Duplicate of this bug: 973834

Comment 12

4 years ago
related to Bug 805343 ?
(I must of switch the comment by mistake)
Component: Graphics → CSS Parsing and Computation
(Reporter)

Updated

4 years ago
Duplicate of this bug: 986423
Whiteboard: [Power]
New measurements on the attached test case, on Mac, measured with |mach power|:

Nightly:

>     total W = _pkg_ (cores + _gpu_ + other) + _ram_ W
> #01  6.69 W =  4.92 ( 0.46 +  0.62 +  3.84) +  1.78 W
> 
> 1 sample taken over a period of 30.000 seconds
> 
> Name                               ID     CPU ms/s  User%  Deadlines (<2 ms, 2-5 ms)  Wakeups (Intr, Pkg idle)  GPU ms/s
> com.apple.Terminal                 724    103.40                                      67.17   48.58             33.65   
>   firefox                          28671  62.17     63.56  0.27    0.00               64.41   46.85             33.65   
>   plugin-container                 28672  36.60     80.21  0.10    0.13               2.27    1.33              0.00    
>   Terminal                         86609  4.98      92.15  0.00    0.00               0.40    0.30              0.00    

Chrome:

>     total W = _pkg_ (cores + _gpu_ + other) + _ram_ W
> #01  5.59 W =  3.91 ( 0.23 +  0.43 +  3.24) +  1.68 W
> 
> 1 sample taken over a period of 30.000 seconds
> 
> Name                               ID     CPU ms/s  User%  Deadlines (<2 ms, 2-5 ms)  Wakeups (Intr, Pkg idle)  GPU ms/s
> com.google.Chrome                  795    102.98                                      79.97   73.34             23.26   
>   Google Chrome Helper             28702  32.16     57.92  0.00    0.00               19.36   18.39             23.27   
>   Google Chrome Helper             28707  51.84     76.20  0.00    0.00               37.62   34.49             0.00    
>   Google Chrome                    28696  21.15     62.82  0.40    0.23               22.96   20.43             0.00    

Safari:

>     total W = _pkg_ (cores + _gpu_ + other) + _ram_ W
> #01  4.50 W =  3.01 ( 0.13 +  0.10 +  2.78) +  1.49 W
> 
> 1 sample taken over a period of 30.000 seconds
> 
> Name                               ID     CPU ms/s  User%  Deadlines (<2 ms, 2-5 ms)  Wakeups (Intr, Pkg idle)  GPU ms/s
> com.apple.Safari                   796    10.87                                       11.96   11.20             0.32    
>   com.apple.WebKit.WebContent      28758  10.85     71.66  0.00    0.00               11.80   11.03             0.32    
>   Safari                           28733  0.02      51.20  0.00    0.00               0.07    0.07              0.00    
>   com.apple.WebKit.Networking      28735  0.01      20.12  0.00    0.00               0.10    0.10              0.00
Power:P3 because the difference with other browsers is relatively small.
Whiteboard: [Power] → [Power:P3]
You need to log in before you can comment on or make changes to this bug.