Skip to content

Brave News on NTP consume a lot of CPU #42021

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

Closed
5 of 6 tasks
atuchin-m opened this issue Nov 1, 2024 · 6 comments · Fixed by brave/brave-core#26336
Closed
5 of 6 tasks

Brave News on NTP consume a lot of CPU #42021

atuchin-m opened this issue Nov 1, 2024 · 6 comments · Fixed by brave/brave-core#26336

Comments

@atuchin-m
Copy link
Contributor

Description

A report from @aseren:

On the MacOS Development build from the fresh master, NTP with News enabled eats more then 50% of CPU core time.

Steps to reproduce

  1. launch a browser with a clean profile
  2. open NTP
  3. enable Brave News
  4. open internal task manager (NTP with news should be opened and active)
  5. check CPU the avg CPU usage from Tab: New Tab for 10-20 sec

Actual result

More than 20% avg CPU usage
Image

Expected result

About zero CPU usage (< 5%)

Reproduces how often

Easily reproduced

Brave version (brave://version info)

Brave 1.71.114 Chromium: 130.0.6723.58 (Official Build) (arm64)
Revision 89c4031c685a4296315a6f421f46275f0b72dd55
OS macOS Version 15.0.1 (Build 24A348)

Channel information

  • release (stable)
  • beta
  • nightly

Reproducibility

  • with Brave Shields disabled
  • with Brave Rewards disabled
  • in the latest version of Chrome

Miscellaneous information

No response

@atuchin-m
Copy link
Contributor Author

The issue is likely to be related to components/common/useRelativeTime.ts introduced in brave/brave-core#25447

getRelativeTime(time) returns negative values:

@atuchin-m
Copy link
Contributor Author

A my quick test on Nightly 1.73.70 Chromium: 131.0.6778.24 (Official Build) nightly (arm64) shows that the issue is fixed.

@atuchin-m atuchin-m added the priority/P2 A bad problem. We might uplift this to the next planned release. label Nov 4, 2024
@kjozwiak
Copy link
Member

kjozwiak commented Nov 5, 2024

The above requires 1.71.123 or higher for 1.71.x verification 👍

@GeetaSarvadnya
Copy link

GeetaSarvadnya commented Nov 6, 2024

Verification PASSED on

Brave | 1.71.123 Chromium: 130.0.6723.116 (Official Build) (64-bit)
-- | --
Revision | 59bc221d7f19c99ab7d3fc00748c1ad47776ae9f
OS | Windows 10 Version 22H2 (Build 19045.5011)
  • Verified the STR from the description
  • Reproduced the issue on 1.71.121 Chromium: 130.0.6723.91
    Image
  • Verified the issue on 1.71.23 and ensured that the CPU/GPU never increased more than ~5% using 1.71.123 Chromium: 130.0.6723.116
Example Example Example
Image Image Image

Verification PASSED on

Brave | 1.71.123 Chromium: 130.0.6723.116 (Official Build) (arm64)
-- | --
Revision | 59bc221d7f19c99ab7d3fc00748c1ad47776ae9f
OS | macOS Version 12.5 (Build 21G72)
  • Verified the STR from the description
  • Reproduced the issue on 1.71.121 Chromium: 130.0.6723.91
    Image
  • Verified the issue on 1.71.23 and ensured that the CPU/GPU never increased more than ~2% using 1.71.123 Chromium: 130.0.6723.116
Example Example Example
Image Image Image

@LaurenWags
Copy link
Member

LaurenWags commented Nov 6, 2024

Verified with

Brave | 1.71.123 Chromium: 130.0.6723.116 (Official Build) (x86_64)
-- | --
Revision | 59bc221d7f19c99ab7d3fc00748c1ad47776ae9f
OS | macOS Version 14.7.1 (Build 23H222)

Reproduced the issue using 1.71.121 Chromium: 130.0.6723.91 and STR from #42021 (comment):

Image

Using 1.71.123 Chromium: 130.0.6723.116 and same STR, confirmed CPU usage was significantly lower:

Example Example Example
Image Image Image

@btlechowski
Copy link

Verified with

Brave 1.71.123 Chromium: 130.0.6723.116 (Official Build) (64-bit)
Revision 59bc221d7f19c99ab7d3fc00748c1ad47776ae9f
OS Linux

Reproduced the issue in 1.71.121

Image

Verified fixed in 1.71.123

Image

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