Closed Bug 1391793 Opened 7 years ago Closed 7 years ago

SharedMemory churn when scrolling reddit in WebRender layers-free

Categories

(Core :: Graphics: WebRender, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: jrmuizel, Assigned: aosmond)

References

Details

Attachments

(1 file)

I see a bunch of time being spent in SourceSurfaceImage::GetTextureClient
Assignee: nobody → aosmond
It looks like this is our biggest performance problem on the client side right now.
It looks like bug 1376855 switched from WebRenderDisplayItemLayer::SendImageContainer to WebRenderLayerManager::CreateImageKey to get the image key. The former would cache the old key and thus most of the time avoid recreating the texture, hence the regression. Additionally bug 1376855 removed the relevant caching code in WebRenderDisplayItemLayer::SendImageContainer (and related) because it was no longer used. Sounds like my work on putting images into a shared buffer has finally become important to finish :).
Assignee: aosmond → aosmond
This appears to be the root cause:

http://searchfox.org/mozilla-central/rev/51b3d67a5ec1758bd2fe7d7b6e75ad6b6b5da223/layout/painting/nsImageRenderer.cpp#629

We get a new ImageContainer each time we request it from the RasterImage, because we don't have a strong reference to it elsewhere and RasterImage only keeps a weak pointer. This results in a container with a different generation ID each time, and forces the ImageClientSingle to flush itself. If I add a strong pointer to the ImageContainer inside RasterImage, we behave as expected.
There are other instances of it recreating the image containers that don't follow the same code path, but this appears to go away when layers free is in use.

try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=c6c4364c81e89281693735841d1d5c00c1df6be8
Attachment #8902833 - Flags: review?(jmuizelaar)
Attachment #8902833 - Flags: review?(jmuizelaar) → review+
Pushed by aosmond@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/f74e7808e0cb
Save the given ImageContainer in WebRenderImageData so that it is not recreated. r=jrmuizel
https://hg.mozilla.org/mozilla-central/rev/f74e7808e0cb
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: