Closed Bug 1531294 Opened 10 months ago Closed 9 months ago

Performance issues on Sketchfab.com with WebRender on

Categories

(Core :: Graphics: WebRender, defect, P2)

defect

Tracking

()

VERIFIED FIXED
mozilla67
Tracking Status
firefox65 --- disabled
firefox66 --- disabled
firefox67 --- verified

People

(Reporter: rares.doghi, Assigned: sotaro)

References

Details

Attachments

(3 files, 3 obsolete files)

Attached video 2019-02-28_13h10_15.mp4

[Affected versions]:
Beta 67.0a1

Steps :

  1. Launch the Firefox Browser and reach https://sketchfab.com/3d-models/the-old-knight-fb720a9fc67443a6907e849a2915f7b7
  2. Wait for the 3D image to load and then move it around, zoom in and out or rotate the image.

Expected Results :

The 3D image should move around and rotate smooth and without issues.

Actual Results :

With WebRender on the 3D image is lagging a lot and drops frames when rotated.

This issue was tested on a Windows 10 with Nvidia GT 730.

Flags: needinfo?(jmuizelaar)

How well does it run for you with WebRender off?

Flags: needinfo?(rares.doghi)

I also notice a performance difference in fullscreen mode.

Sotaro can you reproduce this? If you can. Do you want to take a look at it?

Flags: needinfo?(jmuizelaar) → needinfo?(sotaro.ikeda.g)
Priority: -- → P2

It seems better to uplift Bug 1526213 at first to optimize canvas.

Depends on: 1526213

(In reply to Sotaro Ikeda [:sotaro] from comment #3)

It seems better to uplift Bug 1526213 at first to optimize canvas.

I confirmed that fix of Bug 1526213 suppressed doc.build_frame() call during the STR in comment 0.

I checked the STR of comment 0 with Firefox nightly on my Win10 Intel PC(Intel(R) HD Graphics P530). The performance was very bad compared to non-WebRender(Direct3D 11 (Advanced Layers)). Though on my win10 desktop PC(NVIDIA GeForce GTX 960), I did not saw the performance problem with nightly and with beta.

Profile during the STR of comment 0 on my Win10 Intel PC(Intel(R) HD Graphics P530) with nightly.

https://perfht.ml/2tKrwqI

Main thread of content was blocked at rx::Context11::flush() very long time. The blocked function was actually ID3D11DeviceContext::Flush(). And Render thread was also busy. From it, GPU driver seemed very busy and it seemed to cause the problem.

Flags: needinfo?(sotaro.ikeda.g)

I am going to look into the bug a bit more.

Assignee: nobody → sotaro.ikeda.g

It seems better to check if WaitForGPUQuery() works for the problem.

Hi Jeff, it runs the same at first a bit laggy but after a few seconds it starts moving around a lot smoother as with WebRender ON it's still causing lag and dropped frames, and yes it's even more noticeable in Full Screen.

Flags: needinfo?(rares.doghi)
Attached patch wip patch - Use ID3D11Query (obsolete) — Splinter Review

:jrmuizel, can you check if the win64-pgo build in comment 11 mitigate the problem?

Flags: needinfo?(jmuizelaar)

(In reply to Sotaro Ikeda [:sotaro] from comment #12)

:jrmuizel, can you check if the win64-pgo build in comment 11 mitigate the problem?

This build runs much better for me.

Flags: needinfo?(jmuizelaar)

Thanks for checking! The build run a lot better also for me. When the problem happened, too many gpu requests seemed to freeze D3D api on content main thread and render thread.

Attachment #9047666 - Attachment description: wip patch → wip patch - Use ID3D11Query

By applying attachment 9048411 [details] [diff] [review], when the problem happened, amount of SharedSurface_ANGLEShareHandles became more than 30.

On my high end desktop Win10 PC, the amount was 8 at most.

Attachment #9047666 - Attachment is obsolete: true
Attached patch wip patch - Use Fence (obsolete) — Splinter Review

(In reply to Sotaro Ikeda [:sotaro] from comment #19)

attachment 9048452 [details] [diff] [review] did not caused test failures. But it regressed glterrain a lot :(

On possible workaround is that using Fence only when size of mRecycleTotalPool is large.

Attachment #9048754 - Attachment is obsolete: true
Attachment #9048452 - Attachment is obsolete: true

When I revert Bug 1526213, the problem seemed to be disappeared. "doc.build_frame()" seemed to work as throttling webgl task. Since Bug 1526213 fix, we could skip doc.build_frame() during canvas empty transaction. It caused to webgl task more rapid and d3d11 api stalled by too many gpu tasks.

By Bug 1526213, WebRenderBridgeParent::RecvEmptyTransaction() had a bug. It does not handle a case that resource update is handled by WebRenderTextureHostWrapper. In this case, txn.IsResourceUpdatesEmpty() became true and the function thought there was no resource update and the function returned DidComposite soon to client side. Then it caused over production at SharedSurface_ANGLEShareHandle().

attachment 9049875 [details] is going to loose the performance gain of glterrain of Bug 1526213, but it is correct behavior. Bug 1526213 made a huge over production of SharedSurface_ANGLEShareHandle(). More than 30 SharedSurface_ANGLEShareHandle instances were used for one WebGL. glterrain score does not show actual valid performance. It should be addressed.

https://treeherder.mozilla.org/perf.html#/compare?originalProject=try&originalRevision=3e5e9cfbb44a88e32208323ef7d9a18a8c177f6b&newProject=try&newRevision=fc3d968b84776c871c012abd69185edfaa943f4f&framework=1

Confirmed that attachment 9049875 [details] address the problem of comment 0 on my Win10 Intel laptop.

Pushed by sikeda@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ec39fd695adb
Fix RecvEmptyTransaction() as to handle WebRenderTextureHostWrapper usage case r=mattwoodrow

(In reply to Dorel Luca [:dluca] from comment #28)

Backed out changeset ec39fd695adb (bug 1531294) for webrender failures

Log:
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=233291875&repo=autoland&lineNumber=12947

It is weird, the log said that webrender was not enabled. The change only affect to webrender enabled.

Tests are grouped as Wr2, but it does not mean webrender. The Wr2 is a group of Web platform tests.

Flags: needinfo?(sotaro.ikeda.g)

I wonder if Bug 1531863 is culprit.

(In reply to Sotaro Ikeda [:sotaro] from comment #29)

(In reply to Dorel Luca [:dluca] from comment #28)

Backed out changeset ec39fd695adb (bug 1531294) for webrender failures

Log:
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=233291875&repo=autoland&lineNumber=12947

It is weird, the log said that webrender was not enabled. The change only affect to webrender enabled.

latest auto land already caused same test failures.

https://treeherder.mozilla.org/#/jobs?repo=try&revision=608247da49a0dab39f76fb8c2d69c9984b7ca342

Status: NEW → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67

Hi this issue is Verified as fixed in Firefox 67.0a1 (2019-03-13)on Windows 10 with Nvidia GT 730.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.