Skip to content

[Perf] CPU regression in system_health.common_desktop after cr136 #45564

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
atuchin-m opened this issue Apr 18, 2025 · 2 comments · Fixed by brave/brave-core#28748
Closed

[Perf] CPU regression in system_health.common_desktop after cr136 #45564

atuchin-m opened this issue Apr 18, 2025 · 2 comments · Fixed by brave/brave-core#28748
Assignees
Labels
OS/Android Fixes related to Android browser functionality OS/Desktop perf perf-regression An perf browser issue by the perf dashboard priority/P2 A bad problem. We might uplift this to the next planned release. QA/No release-notes/exclude

Comments

@atuchin-m
Copy link
Contributor

atuchin-m commented Apr 18, 2025

Median of segment before: 1122.449
Median of segment after: 1306.447225
Relative change: 16.4%
Test: BravePerf/mac-mini-x64-typical/system_health.common_desktop/cpuTime:browser_process:all_threads:all_stages:all_initiators/load_site/load_site_example_2023

brave-core range: v1.79.70 - v1.79.71
Windows and MacOS are affected.
Chromium doesn't have this issue.

Image
@atuchin-m atuchin-m added OS/Android Fixes related to Android browser functionality OS/Desktop perf perf-regression An perf browser issue by the perf dashboard labels Apr 18, 2025
@atuchin-m atuchin-m self-assigned this Apr 18, 2025
@atuchin-m atuchin-m added the priority/P2 A bad problem. We might uplift this to the next planned release. label Apr 18, 2025
@atuchin-m
Copy link
Contributor Author

I used my experimental tool to compare traces.
mac-x64:

AddDATBufferToFilterSet_AdBlockComponentFiltersProvider: +59.1%, p-value=0.000,  (191.2±13.7 => 304.2±8.1ms)
ThreadPool_RunTask (ad_block_service.cc:OnFilterSetCallbackLoaded): +59.0%, p-value=0.000,  (191.6±13.7 => 304.5±8.1ms)
ThreadPool_RunTask (downgrade_manager.cc:DeleteMovedUserDataSoon): +57.1%, p-value=0.000,  (41.7±5.4 => 65.5±12.5ms)
MakeEngineWithRules: +10.5%, p-value=0.000,  (208.8±11.6 => 230.6±5.5ms)
ThreadPool_RunTask (ad_block_service.cc:OnResourcesLoaded): +10.1%, p-value=0.000,  (217.2±12.0 => 239.1±5.6ms)

Windows:

ANGLEPlatformImpl::RunWorkerTask: +713.5%, p-value=0.003,  (9.0±0.2 => 73.0±47.8ms)
ThreadPool_RunTask (angle_platform_impl.cc:ANGLEPlatformImpl_postWorkerTask): +705.8%, p-value=0.003,  (9.1±0.2 => 73.2±47.8ms)
AddDATBufferToFilterSet_AdBlockComponentFiltersProvider: +42.4%, p-value=0.000,  (292.0±8.1 => 415.7±15.8ms)
ThreadPool_RunTask (ad_block_service.cc:OnFilterSetCallbackLoaded): +42.2%, p-value=0.000,  (293.1±8.2 => 416.7±15.8ms)

The most significant difference is in Rust-implement methods that are called via ad_block_service.cc. adblock-rust wasn't updated, but the Rust compiler and libraries were.

@atuchin-m
Copy link
Contributor Author

Profiling before/after showed the difference in the regex internals.
regex_automata features were changed in upstream: perf-* features were disabled.
That resulted in using slow, less-optimal regex implementation.

before/after:
Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS/Android Fixes related to Android browser functionality OS/Desktop perf perf-regression An perf browser issue by the perf dashboard priority/P2 A bad problem. We might uplift this to the next planned release. QA/No release-notes/exclude
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants