brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.62k stars 2.29k forks source link

CPU spike to `>100%` on https://wallet.uphold.com/dashboard while shields is enabled #20552

Open kjozwiak opened 2 years ago

kjozwiak commented 2 years ago

Description

It looks the CPU spikes to about ~30-60% on both Chrome & Brave when visiting https://wallet.uphold.com/dashboard. However, when Brave Shields is enabled, the CPU increases to ~100-130% consistently. Once this happens, depending on the machine you have, it can cause issues with performance including PC performance.

There's definitely an optimization that Uphold and do regarding https://wallet.uphold.com/dashboard but we need to find out why Brave goes to 100% when shields are enabled.

Steps to Reproduce

Cases below assumes you have a brand new profile with no tabs (easiest way to see the CPU spikes due to a single tab/website)

  1. open https://wallet.uphold.com/dashboard and watch the CPU increase to 100% while shields are enabled
  2. disable shields and you'll notice that the CPU will go to about ~60% or so
  3. close https://wallet.uphold.com/dashboard and you'll notice that the CPU will drop to ~2-3%

Actual result:

Shields Enabled on Dashboard Shields Disabled on Dashboard Navigated away form Dashboard
image image image (1)

You can see that CPU is reaching max clock speed when https://wallet.uphold.com/dashboard is opened:

Dashboard opened Dashboard closed
image (2) image (3)

Expected result:

The website should be optimized by Uphold but Brave should be performing the same when shields are enabled. Meaning that the CPU should be spiking to ~30-60% and not staying at ~100-120%` the entire time and hogging recourses.

Reproduces how often:

100% reproducible using the STR/Cases outlined above.

Brave version (brave://version info)

Brave | 1.36.41 Chromium: 97.0.4692.71 (Official Build) nightly (64-bit)
-- | --
Revision | adefa7837d02a07a604c1e6eff0b3a09422ab88d-refs/branch-heads/4692@{#1247}
OS | Windows 11 Version 21H2 (Build 22000.434)
Brave | 1.34.80 Chromium: 97.0.4692.71 (Official Build) (64-bit)
-- | --
Revision | adefa7837d02a07a604c1e6eff0b3a09422ab88d-refs/branch-heads/4692@{#1247}
OS | Windows 11 Version 21H2 (Build 22000.434)

Version/Channel Information:

Other Additional Information:

Miscellaneous Information:

atuchin-m commented 2 years ago

Some extra info: the CPU usage is triggered by continuous page recalculating styles (to see it do: Devtool->Performance->Record) Bad: image (7)

Good: image (8)

atuchin-m commented 2 years ago

Also in Chrome 98.0.4758.54 beta + uBlock the CPU usage is the same as in Brave with Shield on. And again a lot of "Recalculating Styles".

image