Open Bug 1591030 Opened 5 years ago Updated 2 years ago

Images flash when returning to a tab

Categories

(Core :: Graphics: ImageLib, defect, P3)

72 Branch
defect

Tracking

()

Performance Impact low
Tracking Status
firefox70 --- affected
firefox71 --- affected
firefox72 --- affected

People

(Reporter: giul.mus, Unassigned)

References

(Depends on 2 open bugs, Blocks 1 open bug)

Details

(Keywords: perf, perf:responsiveness)

Attachments

(1 file)

To reproduce, visit https://www.will-kelsey.com/smith_chart/, browse to another tab and let the other sit for a few minutes, then return to it. You'll see that the images will not appear for a small but noticeably delay.

Note that this happens even with JavaScript disabled, and does not occur on any other website for me. Performance bottlenecks are likely not the cause, since I can see from gnome-system-monitor that CPU usage is low with no spikes, there's plenty of free RAM, and no hard disk to cause blocking IO.

Product: Firefox → Core

The priority flag is not set for this bug.
:nhi, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(nhnguyen)

sending to ImageLib. Feel free to bounce back to me if that's the wrong component.

Component: General → ImageLib
Flags: needinfo?(nhnguyen)

(In reply to giul.mus from comment #0)

To reproduce, visit https://www.will-kelsey.com/smith_chart/, browse to another tab and let the other sit for a few minutes, then return to it. You'll see that the images will not appear for a small but noticeably delay.

Which images specifically on that site?

You can probably speed up your steps by replacing "sit for a few minutes" with "open about:memory in a tab and click minimize memory usage".

Flags: needinfo?(giul.mus)

Which images specifically on that site?

Some images in the first row plus the "black box" image in the second row. I'm attaching a screencast, slowed down 4x.

Flags: needinfo?(giul.mus)

I forced there to be a single decoder thread and could reproduce a similar effect on 70:

https://perfht.ml/2NWB77t

It is a fairly complicated pipeline, doing color management, downscaling and ADAM7 interpolation. The images are all much larger than they appear (say 500x500) which contributes to the problem.

Similar trace on 72 / nightly, which includes the premultiplication SSE2 improvements:

https://perfht.ml/34JvYGq

Could you install https://profiler.firefox.com/, make sure you tick GeckoMain/Compositor/Renderer/ImgDecoder under threads, and also tick Screenshots in addition to the recommended defaults, and collect a profile using the instructions at the given link? Ideally on 72 / nightly, since it ought to be the fastest for this particular use case (for me it is ~1/3 faster to decode as from the traces). Make sure you tab switch using the keyboard rather than the mouse to avoid the impact from tab warming that may hide the flicker due to kicking off the decoding early. Thanks!

Flags: needinfo?(giul.mus)
Flags: needinfo?(giul.mus)

Okay, similar proportions of time spent decoding images as for me (but a slower processor). I imagine bug 1280552 would help given we spend a fair amount of time doing ADAM7 interpolation. I wonder if it is possible to decrease the time spent in color management too, without a significant cost to the general case -- most of the image is pure transparency and so doesn't actually require any color management on most pixels.

Status: UNCONFIRMED → NEW
Has Regression Range: --- → irrelevant
Has STR: --- → yes
Depends on: 1280552
Ever confirmed: true
Keywords: perf
OS: Unspecified → All
Priority: -- → P3
Hardware: Unspecified → All
Whiteboard: [qf]
Whiteboard: [qf] → [qf:responsiveness:p3]
Whiteboard: [qf:responsiveness:p3] → [qf:p3:responsiveness]
Performance Impact: --- → P3
Whiteboard: [qf:p3:responsiveness]
Severity: minor → S4
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: