Open Bug 1902867 Opened 1 year ago Updated 7 months ago

WebGL aquarium - Firefox much slower than Chromium/Edge

Categories

(Core :: Graphics: CanvasWebGL, defect)

Desktop
All
defect

Tracking

()

People

(Reporter: 08xjcec48, Unassigned)

References

(Depends on 1 open bug)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:127.0) Gecko/20100101 Firefox/127.0

Steps to reproduce:

Actual results:

Edge: 60 fps
Firefox: 33 fps

Both browsers have uBlock Origin with the same selection of lists.

https://share.firefox.dev/3xkZSFa

Component: Untriaged → Graphics: CanvasWebGL
OS: Unspecified → Windows 10
Product: Firefox → Core
Hardware: Unspecified → Desktop
See Also: → 1653777
See Also: → 1902819
Attached file about-support.txt
See Also: 1902819
Attachment #9407968 - Attachment mime type: text/plain → application/json

Looking at the profile, I think the way we do WebGL remoting (content processes sending IPC messages to the GPU process) is probably responsible for all of the difference in observed performance here, whereas chromium-based browsers run the OpenGL ES calls in the content processes (i.e. every content process is a GPU process), we do it remotely to avoid giving the content processes access to the GPU (a security/performance tradeoff).

Severity: -- → S3

I'm seeing even larger difference with 30,000 fish using 5700x/6700XT:
Edge: 80 fps
Nightly: 29 fps
Nightly with Angle disabled: 44 fps

Version: Firefox 127 → Trunk
OS: Windows 10 → All
Summary: WebGL aquarium - Firefox much slower than Edge (Ryzen 7 5700u) → WebGL aquarium - Firefox much slower than Chromium/Edge
Status: UNCONFIRMED → NEW
Ever confirmed: true

Here are profiles from Bas:
Chrome
Firefox

They suggest to me our WebGL serialization is a lot more expensive than Chrome's is.

Two thing that stand out:

  1. We spending a lot of time shared_ptr incRef/decRef (presumably because it's atomic)
  2. We spending a bunch of time zero filling on demand: KiPageFault. Presumably, because we're allocating a bunch of fresh buffers every frame.
Depends on: 1976241
Depends on: 1976319

Just an update from my test last year after 1976241 which was reported to increase fps by ~20%.

Now I'm seeing with same config:
Edge: 20 fps (-60 fps regression)
Nightly: 33 fps (+4 fps, though it was ~32 before 1976241)
Nightly with Angle disabled: 45 fps (+1 fps, though it regressed to ~43 from other changes)

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: