Open Bug 1915251 Opened 5 months ago Updated 4 months ago

We seem to redecode images during speedometer news-site-next

Categories

(Core :: Graphics: ImageLib, defect)

defect

Tracking

()

People

(Reporter: jrmuizel, Unassigned, NeedInfo)

References

(Blocks 1 open bug)

Details

(Whiteboard: [sp3])

We seem to be redecoding resources/newssite/news-next/dist/placeholder_light.jpg multiple times when running speedometer.

See this profile from Android https://share.firefox.dev/3T6pQDL

In https://share.firefox.dev/3yScC6X on desktop we don't seem to have profile markers for when we decode images. At a minimum we should probably add those.

Blocks: speedometer3
Flags: needinfo?(tnikkel)

So on each iteration the multiple decodes are because the image is used at different sizes, and the decodes are at different sizes. On a real news site each of those images would be a different image, so it wouldn't be multiple decodes. So that doesn't really seem like a problem. Perhaps the test should be altered to make it more realistic?

Then after an iteration the presshell is destroy which discards the decoded copy immediately, and the new iteration we decode again. We could be slightly less aggressive on this discard perhaps. I believe there was a reason why we were this discard was introduced with a large amount getting accumulated in the past. We could maybe just do the discard a little slower to avoid the re-decodes. The decodes are off main thread, so the speed up would be small likely, and the benefit to real sites limited to less usual conditions I think.

(In reply to Timothy Nikkel (:tnikkel) from comment #1)

So on each iteration the multiple decodes are because the image is used at different sizes, and the decodes are at different sizes. On a real news site each of those images would be a different image, so it wouldn't be multiple decodes. So that doesn't really seem like a problem. Perhaps the test should be altered to make it more realistic?

What are the sizes?

1280 720, 260 146, 320 180, 336 189, 337 189, 344 194, 459 258, 459 259, 469 264, 640 360, 705 397, 720 405

If you step through the test you can see the placeholder image used at different sizes. I haven't checked if each size is necessary. Perhaps the 1280 720 size is unnecessary (the origial size of the image file), maybe 640 360 as well because it's half and I'm testing on a 2x retina screen.

Whiteboard: [sp3]
Severity: -- → S4
You need to log in before you can comment on or make changes to this bug.