Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebGL performance issues #4279

Closed
PhilT opened this issue May 1, 2019 · 11 comments
Closed

WebGL performance issues #4279

PhilT opened this issue May 1, 2019 · 11 comments

Comments

@PhilT
Copy link

PhilT commented May 1, 2019

Performance of WebGL compared with Chrome and Chromium is subpar

Whilst playing around with some WebGL 2 code I noticed that fps seemed to be roughly half of what Chrome was chucking out. Rendering 2 million cubes produced around 29fps whilst in Chrome it easily hit 60fps.

So I ran some more tests with a proper benchmark site https://web.basemark.com. These were all run on my Razer Blade 14 (2017) running Windows 10 x64.

Here are my results:

  • Brave Nightly 0.66.24 (Chromium: 74.0.3729.108) - Score: 585.08 (didn't complete)
  • Brave Release 0.63.48 (Chromium: 74.0.3729.108) - Score: 531.3
  • Chrome 74.0.3729.108 - Score: 926.73
  • Chromium 74.0.3729.108 - Score: 947.62

These confirmed my suspicions and is quite substantial.

I did notice that Chrome has some additional Driver Bug Workarounds under chrome://gpu

  • disable_delayed_copy_nv12
  • disable_direct_composition_layers

And one additional one in Brave Release:

  • msaa_is_slow

If I had to guess I'd say this could be related to having a laptop with Intel and NVIDIA graphics cards. Those options that have been toggled above look like they're related to picking the wrong card. But it's just a guess.

Happy to provide more info or do more tests if needed.

@rebron rebron added the perf label May 10, 2019
@rebron
Copy link
Collaborator

rebron commented May 10, 2019

cc: @kjozwiak

@bsclifton
Copy link
Member

@PhilT would you be able to try this again on our latest Nightly version? We did some config changes which may help 😄

@PhilT
Copy link
Author

PhilT commented Jul 3, 2019

Hi @bsclifton, unfortunately performance is the same. Still down at around 10fps (I've changed the test a bit so fps has dropped but it's same on Stable) on my test whereas Chrome is getting about 45fps.

Tested on Version 0.69.24 Chromium: 75.0.3770.100 (Official Build) nightly (64-bit) that I just installed.

@bsclifton
Copy link
Member

+1 from https://www.reddit.com/r/brave_browser/comments/c8oe0b/webgl_is_very_slow_in_brave_compared_to_chrome/

Details from chrome://gpu here (Brave):
https://gist.github.com/bsclifton/68e1ba1ee28cb1502d4b04eacf48228a

Same user running chrome://gpu in Chrome:
https://gist.github.com/bsclifton/573d8d4cbfe9065ae3e5c1e9aabb2861

@bsclifton
Copy link
Member

bsclifton commented Jul 3, 2019

Ran the above test on my machine - definitely leads me to think it's a driver/config issue. Something triggers the difference in config change and that seems to have a direct impact on the score

FWIW, here are the scores I got on my workstation:

  • 1190.75 with Chrome 75.0.3370.100
  • 1402.33 with Brave 0.69.24 (Nightly, which uses Chromium 75.0.3770.100)

@PhilT can you visit chrome://gpu both in Brave and Chrome and use the handy Copy Report to Clipboard button? Would be great to get a copy of each in a GitHub Gist (or similar way to share) 😄

For folks reading this- there are definitely some known GPU issues with Brave. Seems to be config specific for each type of problem (GPU taking too much power, bad webGL performance, artifacts drawn on screen), so I'm doing some detective work and cataloging the data here:
https://github.com/brave/brave-browser/wiki/GPU-issues---incident-reports

@kjozwiak
Copy link
Member

@bsclifton not sure if helpful, but here are my results on two different machines which had similar scores. I didn't see any large discrepancies between the two browsers on those particular machines. Probably related to GPU drivers as you pointed out above:

macOS 10.14.5 using Radeon Pro 560 4 GB & Intel HD Graphics 630 1536 MB Results:

  • 0.69.48 CR 75.0.3770.100 (default settings) --> score: 738.29

    • CSS Capabilities: 57.5%
    • HTML5 Capabilities: 96.58%
    • Page Load and Responsiveness Capabilities: 91.05%
    • Resize Capabilities: 75.97%
  • Chrome 75.0.3770.100 (default settings) --> score: 723.25

    • CSS Capabilities: 57.75%
    • HTML5 Capabilities: 96.58%
    • Page Load and Responsiveness Capabilities: 90.93%
    • Resize Capabilities: 75.97%

Windows 10 x64 using GeForce GTX 670 Results:

  • 0.69.47 CR 75.0.3770.100 (default settings) --> score: 751.76

    • CSS Capabilities: 57.75%
    • HTML5 Capabilities: 96.58%
    • Page Load and Responsiveness Capabilities: 92.47%
    • Resize Capabilities: 75.97%
  • Chrome 75.0.3770.100 (default settings) --> score: 720.63

    • CSS Capabilities: 57.75%
    • HTML5 Capabilities: 96.58%
    • Page Load and Responsiveness Capabilities: 91.81%
    • Resize Capabilities: 75.97%

@PhilT
Copy link
Author

PhilT commented Jul 10, 2019

So, I've just run my own test on my new machine and I get the same result in both Chrome, Chromium and Brave. All about 10-11fps (1 million cubes on the screen).

Kinda annoyed as the new machine, a Razer Blade Pro RTX 2060, cost a lot and is not performing the same as my 2 year old Blade 14! However, it does mean the config must be off.

I'm gonna have a dig around to try to find some guides on how to optimize the setup. If you have anything that might help config-wise, I'd be happy to try it. I'll run the performance test as well, when I get a moment.

@PhilT
Copy link
Author

PhilT commented Jul 10, 2019

Okay, so I'm a bit of an idiot and forgot to set nVidia as the card to use when running Chrome/Brave. So now I'm getting around 30fps on all 3 browsers with Chromium actually hitting about 33-34 oddly.

This is still less than my other machine which technically has an older, slower(?) graphics card. 10-15fps is still a pretty big gap so I'll do some more digging when I have time.

@PhilT
Copy link
Author

PhilT commented Jul 11, 2019

So this is better.

  • 1223.25 on Brave Version 0.66.99 Chromium: 75.0.3770.100 (Official Build) (64-bit)
  • 1204.01 on Brave Version 0.69.44 Chromium: 75.0.3770.100 (Official Build) nightly (64-bit)
  • 1227.03 on Chromium 75.0.3770.100

I'll run some more tests and grab some averages.

@PhilT
Copy link
Author

PhilT commented Jul 11, 2019

I've run the benchmark a few more times and I'm getting consistently lower scores on the nightly build than either Brave stable or Chromium. However, the numbers do vary a bit (lows of 1195 on Nightly and highs of 1327 on stable). However, maybe those optimisations are helping some GPUs and hindering others.

@bsclifton
Copy link
Member

Closing as unfortunately there aren't any clear steps to investigate or debug this issue. Also no folks giving a +1 or creating similar issues. I ran again to just check and things look good:

  • 1348.5 on Brave Version 1.17.11 Chromium: 86.0.4240.68
  • 1290.79 on Chrome Version 85.0.4183.121

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants