brave / brave-browser

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

Speedometer 2.1 score dropped significantly since v1.61 #34772

Open valynor opened 11 months ago

valynor commented 11 months ago

1.61.101 Chromium: 120.0.6099.71 (Official Build) (arm64) on Mac Studio M1 Max, macOS 14.1.2

Since updating to Brave 1.61 the Speedometer 2.1 score has dropped significantly. In a guest window I got 420-430 before and now it is down to 350-360 points across multiple tests. Interestingly the deprecated Octane Benchmark shows better scores than ever before around 80700.

Safari 17.2 still gets ~405 on https://browserbench.org/Speedometer2.1/

Please investigate, ~80 points less is quite a huge drop.

rebron commented 11 months ago

cc: @atuchin-m

atuchin-m commented 11 months ago

@valynor thanks for the report.

  1. We have a CI platform to track the performance, it's included speedometer2 on m1 mac. According to it the results, Brave on CR120 is event better than on CR119.

    Screenshot 2023-12-08 at 15 13 05
  2. A local MBP M1 pro mac gives me: ~400 on Brave 1.60.125 ~422 on Brave 1.61.101 ~419 on Chrome 119.0.6045.199 ~441 on Chrome 120.0.6099.71

So I can't confirm the issue neither for my MBP or for CI bots (mac mini-m1). I admit than the result could degrade to some specific configuration, but we need more data to continue the investigation.

cc @iefremov

atuchin-m commented 11 months ago

I suggest to check it againt:

If you confirm the issue, we will try to find folks with a similar machine to get a reproduction.

atuchin-m commented 11 months ago

@valynor Another thing to check: does it work well for a usual session (not in a guest window)?

stephendonner commented 11 months ago

Here are my results on

Brave | 1.61.100 Chromium: 120.0.6099.62 (Official Build) (arm64)
-- | --
Revision | 63d361b4e5fd163e032192aa8e033cf85f846575
OS | macOS Version 13.6.1 (Build 22G313)
395 example 404 example 401 example
Screenshot 2023-12-08 at 8 50 44 AM Screenshot 2023-12-08 at 8 50 48 AM Screenshot 2023-12-08 at 8 51 16 AM Screenshot 2023-12-08 at 8 51 19 AM Screenshot 2023-12-08 at 8 51 47 AM Screenshot 2023-12-08 at 8 51 50 AM

And on

Brave | 1.61.101 Chromium: 120.0.6099.71 (Official Build) (arm64)
-- | --
Revision | a2125180c183a2b5775b45c2138fda37d240b773
OS | macOS Version 13.6.1 (Build 22G313)
example example example example example example
Screenshot 2023-12-08 at 8 56 46 AM Screenshot 2023-12-08 at 8 57 14 AM Screenshot 2023-12-08 at 8 57 39 AM Screenshot 2023-12-08 at 8 59 19 AM Screenshot 2023-12-08 at 9 00 01 AM Screenshot 2023-12-08 at 9 00 29 AM

https://browserbench.org/Speedometer2.1/?iterationCount=100

example example
Screenshot 2023-12-08 at 10 15 54 AM Screenshot 2023-12-08 at 10 16 11 AM
valynor commented 11 months ago

@atuchin-m Sorry for the late reply, I was trying to get to the bottom of this issue all day long but to no avail:

  • reboot the machine, stop the other process, check no background activity in Activity Monitor

Rebooted several times, no other apps running

Screenshot 2023-12-08 at 21 27 21

  • check the stabilty of the internet connection(yes, it can affect the results)

I know my InterNet connection is fine but I checked anyway:

Screenshot 2023-12-08 at 21 30 25

This is exactly the maximum my connection can deliver.

  • take a fresh clean temporary browser profile (no extensions, no cache, etc): "/Applications/Brave Browser.app/Contents/MacOS/Brave Browser" --user-data-dir=/tmp/clean_tmp_profile_1

When I do that I instantly get 426-446 Speedometer 2.1 scores - every time. Going back to my default profile (with extensions, I know uBlock Origin slows down this benchmark a bit) I get ~320-330 and in a guest window it's ~350.

Some other things I tried:

At this point I decided to remove Brave completely via App Cleaner, rebooted and did a fresh install. And this is where it gets really spooky, because I have no idea what's going on or how this is even possible:

I launched the freshly installed Brave, went straight to a guest window and: ­~350 score.

So I synced back my usual profile via sync chain ... still 350 score but I decided to test some more, this time in the default profile:

I can guess what you are thinking now ... it's the hardware.

IMHO the tests on Safari and the Brave tmp profile strongly suggest that the issue is not my hardware but that somehow Brave is responsible for this. Any suggestions how to proceed from here would be very welcome. I had no issues with Brave at all before the v1.61 update, the browser didn't even crash once in well over a year.

I'd also like to point out my other recent bug report #34783 which might or might not be related.

Edit: Did a couple more consecutive Speedometer runs in Safari and this is perfectly reproducible: Safari score remains stable around 400, Brave default profile score quickly goes down and crashes the tab after ~­8 runs. Here's the crash report from the last tab crash that I provoked this way:

Crash from Saturday, 9 December 2023 at 00:46:52 Status: Uploaded
Uploaded crash report ID: 91b20500-8bde-260b-0000-000000000000
Upload time: Saturday, 9 December 2023 at 00:46:54
Local crash context: 7496d1ac-f966-496d-a5f7-2cc3d3995952
atuchin-m commented 11 months ago

Thanks for the details report @valynor.

At this point I decided to remove Brave completely via App Cleaner, rebooted and did a fresh install.

Was at a fresh install with preserving your data (= the default user-data-dir)?

creating a new user profile: no change

do you using Add New profile via menu in the default user-data-dir?

If I do 1-2 more runs after this the tab crashes

thanks for the crash report. I've checked https://github.com/brave/brave-browser/issues/34783, it can't affect speedometer results. Reported to the team. As for 91b20500-8bde-260b-0000-000000000000 it's a renderer out-of-memory crash. The crash dump also shows that you have some extensions installed. Could you please double check you have nothing at brave://extensions ?

It's definitely not the hardware, because you have the stable good results on a clean profile. I suspect it's related to the browser settings (they affect to all the profiles in a user-data-dir). In theory, it also could be some an OS level feature or an application.

I suggest the following to found what affect the results:

  1. check the number of javascript context on speedometer page (see the screenshot)
  2. check brave://flags/, make sure anything in the default state.
  3. disabled any extra lists on brave://settings/shields/filters
  4. try to disable any non default flags in brave://settings. You can compare brave://settings on/tmp/clean_tmp_profile_1 with your default installation.
  5. share brave://version/?show-variations-cmd

Also check 'Details' tabs when you look at speedometer2 results. In case of network level delays the first result of the row could be extremely low, that could major affect the final score.

You could also use https://browserbench.org/Speedometer2.1/?iterationCount=100 to get 10x more iterations (so you do need to repeat the test multiple times). It also reduces the first result "lag".

image
valynor commented 11 months ago

@atuchin-m

Was at a fresh install with preserving your data (= the default user-data-dir)?

No, I used App Cleaner ( https://freemacsoft.net/appcleaner/ ) which gets rid of almost everything from a macOS install but I went to ~/Library/Application Support/BraveSoftware and there were some files left so I deleted the entire directory manually.

I also did a Finder search in ~/Library/ for "Brave" after that and found nothing so I'm confident to say it was a completely fresh install with no data from the previous install left.

"Brave-Browser.dmg" was a fresh download from https://brave.com/download/, too.

do you using Add New profile via menu in the default user-data-dir?

That was just one of the things I tried yesterday and it did not help to get the ~430 Speedometer results.

thanks for the crash report. I've checked #34783, it can't affect speedometer results. Reported to the team. As for 91b20500-8bde-260b-0000-000000000000 it's a renderer out-of-memory crash. The crash dump also shows that you have some extensions installed. Could you please double check you have nothing at brave://extensions ?

That crash happened while using my usual default profile, i.e. with extensions:

Screenshot 2023-12-09 at 16 18 50

Of these only uBO got updated recently.

These are my Brave Shields settings:

Screenshot 2023-12-09 at 16 24 50

I switched off "Trackers and Ads blocking" in Brave Shields to not conflict with uBlock Origin.

  1. disabled any extra lists on brave://settings/shields/filters

Confirmed, there are no extra lists enabled (I removed them earlier because I don't use the Brave blocking anyway).

You could also use https://browserbench.org/Speedometer2.1/?iterationCount=100 to get 10x more iterations (so you do need to repeat the test multiple times). It also reduces the first result "lag".

I just did that in my standard user profile (with extensions) and it crashed the tab at 1635/4800 iterations. Then I added "browserbench.org" to the trusted sites in uBlock Origin 1.54 (effectively turning off uBO for this domain) and it ran to 4800/4800 without issue (score 343). I then repeated this in a guest window and again 4800/4800, score 347.

So it seems that uBlock Origin is causing the tab crashes and probably the slowdowns too when doing long Speedometer runs.

But I'm still not getting the expected ~430 score in a guest window, only when using "/Applications/Brave Browser.app/Contents/MacOS/Brave Browser" --user-data-dir=/tmp/clean_tmp_profile_1

It's definitely not the hardware, because you have the stable good results on a clean profile. I suspect it's related to the browser settings (they affect to all the profiles in a user-data-dir). In theory, it also could be some an OS level feature or an application.

Just for reference, I only have these two 3rd party apps running in the background, everything else is stock Sonoma:

  1. check the number of javascript context on speedometer page (see the screenshot)

Screenshot 2023-12-09 at 16 53 45

  1. check brave://flags/, make sure anything in the default state.

I have not changed anything in flags and it's all on default.

  1. share brave://version/?show-variations-cmd
`
Brave
1.61.101 Chromium: 120.0.6099.71 (Official Build) (arm64)
Revision a2125180c183a2b5775b45c2138fda37d240b773
OS macOS Version 14.1.2 (Build 23B92)
JavaScript V8 12.0.267.8
User agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Command Line /Applications/Brave Browser.app/Contents/MacOS/Brave Browser --disable-domain-reliability --enable-dom-distiller --enable-distillability-service --origin-trial-public-key=bYUKPJoPnCxeNvu72j4EmPuK7tr1PAC7SHh8ld9Mw3E=,fMS4mpO6buLQ/QMd+zJmxzty/VQ6B1EUZqoCU04zoRU= --sync-url=https://sync-v2.brave.com/v2 --lso-url=https://no-thanks.invalid --variations-server-url=https://variations.brave.com/seed --variations-insecure-server-url=https://variations.brave.com/seed --flag-switches-begin --flag-switches-end --component-updater=url-source=https://go-updater.brave.com/extensions
Executable Path /Applications/Brave Browser.app/Contents/MacOS/Brave Browser
Profile Path /Users/valynor/Library/Application Support/BraveSoftware/Brave-Browser/Default
Linker lld
Active variations AllowCertainClientHintsStudy:EnabledBraveAIChatEnabledStudy:EnabledBraveAdblockMobileNotificationsListDefault:EnabledBraveAds.AdServingStudy:DefaultAdNotificationsPerHour=10/MaximumAdNotificationsPerDay=100/MaximumInlineContentAdsPerHour=6/MaximumInlineContentAdsPerDay=20/AdServingVersion=2BraveAutoTranslateStudy:AutoTranslateDisabledBraveCleanupSessionCookiesOnSessionRestore:DisabledBraveDebounceStudy:EnabledBraveForgetFirstPartyStorage:EnabledBraveGoogleSignInPermissionStudy:DisabledBraveHttpsByDefaultRolloutStudy:EnabledBraveP3AConstellationReleaseRollout:EnabledBraveRewardsWebUiPanelStudy:EnabledBraveScreenFingerprintingBlockerStudy:EnabledBraveSearchAdStudy:EnabledInProcessDesktopClampPlatformVersionClientHint:DisabledCookieListDefaultStudy:EnabledCrossPlatformVPNStudy:EnabledDefault1pBlockingStudy:DisabledDisableReduceLanguage:EnabledEphemeralStorageStudy:EnabledFirstPartyEphemeralDomainBlockStudy:EnabledForceDisableBlinkFeatures:EnabledMacCoreLocationBackendStudy:EnabledPartitionBlinkMemoryCacheStudy:EnabledPartitionConnectionsByNetworkIsolationKeyStudy:EnabledPermissionLifetimeReleaseStudy:EnabledSmilAutoSuspendOnLagKillSwitch:Disabled_EmergencyKillSwitchUserActivityStudy:TriggersWhatsNewStudy:Enabled
Command-line variations --force-fieldtrials="AllowCertainClientHintsStudy/Enabled/BraveAIChatEnabledStudy/Enabled/BraveAdblockMobileNotificationsListDefault/Enabled/BraveAds.AdServingStudy/DefaultAdNotificationsPerHour=10/MaximumAdNotificationsPerDay=100/MaximumInlineContentAdsPerHour=6/MaximumInlineContentAdsPerDay=20/AdServingVersion=2/BraveAutoTranslateStudy/AutoTranslateDisabled/BraveCleanupSessionCookiesOnSessionRestore/Disabled/BraveDebounceStudy/Enabled/BraveForgetFirstPartyStorage/Enabled/BraveGoogleSignInPermissionStudy/Disabled/BraveHttpsByDefaultRolloutStudy/Enabled/BraveP3AConstellationReleaseRollout/Enabled/BraveRewardsWebUiPanelStudy/Enabled/BraveScreenFingerprintingBlockerStudy/Enabled/BraveSearchAdStudy/EnabledInProcessDesktop/ClampPlatformVersionClientHint/Disabled/CookieListDefaultStudy/Enabled/CrossPlatformVPNStudy/Enabled/Default1pBlockingStudy/Disabled/DisableReduceLanguage/Enabled/EphemeralStorageStudy/Enabled/FirstPartyEphemeralDomainBlockStudy/Enabled/ForceDisableBlinkFeatures/Enabled/MacCoreLocationBackendStudy/Enabled/PartitionBlinkMemoryCacheStudy/Enabled/PartitionConnectionsByNetworkIsolationKeyStudy/Enabled/PermissionLifetimeReleaseStudy/Enabled/SmilAutoSuspendOnLagKillSwitch/Disabled_EmergencyKillSwitch/UserActivityStudy/Triggers/*WhatsNewStudy/Enabled/" --force-fieldtrial-params="BraveAds%2EAdServingStudy.DefaultAdNotificationsPerHour%3D10%2FMaximumAdNotificationsPerDay%3D100%2FMaximumInlineContentAdsPerHour%3D6%2FMaximumInlineContentAdsPerDay%3D20%2FAdServingVersion%3D2:ad_serving_version/2/default_ad_notifications_per_hour/10/maximum_ad_notifications_per_day/100/maximum_inline_content_ads_per_day/20/maximum_inline_content_ads_per_hour/6,UserActivityStudy.Triggers:idle_time_threshold/5s/threshold/0%2E5/time_window/1h/triggers/0D0B14110D0B14110D0B14110D0B1411%3D-1%2E0%3B0D0B1411070707%3D-1%2E0%3B07070707%3D-1%2E0%3B0B1512%3D0%2E5%3B0B1513%3D0%2E5%3B0B1514%3D0%2E5%3B06%3D1%2E0%3B04%3D0%2E5,WhatsNewStudy.Enabled:target_major_version_stable/1%2E60" --enable-features="AIChat<BraveAIChatEnabledStudy,AdServing<BraveAds.AdServingStudy,AllowCertainClientHints<AllowCertainClientHintsStudy,BraveAdblockCookieListDefault<CookieListDefaultStudy,BraveAdblockMobileNotificationsListDefault<BraveAdblockMobileNotificationsListDefault,BraveBlockScreenFingerprinting<BraveScreenFingerprintingBlockerStudy,BraveDebounce<BraveDebounceStudy,BraveDomainBlock1PES<FirstPartyEphemeralDomainBlockStudy,BraveFirstPartyEphemeralStorage<FirstPartyEphemeralDomainBlockStudy,BraveForgetFirstPartyStorage<BraveForgetFirstPartyStorage,BraveP3AConstellation<BraveP3AConstellationReleaseRollout,BraveReduceLanguage<DisableReduceLanguage,BraveRewardsWebUIPanel<BraveRewardsWebUiPanelStudy,BraveVPN<CrossPlatformVPNStudy,BraveVPNLinkSubscriptionAndroidUI<CrossPlatformVPNStudy,EphemeralStorage<EphemeralStorageStudy,HttpsByDefault<BraveHttpsByDefaultRolloutStudy,MacCoreLocationBackend<MacCoreLocationBackendStudy,PartitionBlinkMemoryCache<PartitionBlinkMemoryCacheStudy,PartitionConnectionsByNetworkIsolationKey<PartitionConnectionsByNetworkIsolationKeyStudy,PartitionExpectCTStateByNetworkIsolationKey<PartitionConnectionsByNetworkIsolationKeyStudy,PartitionHttpServerPropertiesByNetworkIsolationKey<PartitionConnectionsByNetworkIsolationKeyStudy,PartitionSSLSessionsByNetworkIsolationKey<PartitionConnectionsByNetworkIsolationKeyStudy,PermissionLifetime<PermissionLifetimeReleaseStudy,ShouldAlwaysRunBraveAdsService<BraveSearchAdStudy,ShouldAlwaysTriggerBraveSearchResultAdEvents<BraveSearchAdStudy,ShouldLaunchBraveAdsAsInProcessService<BraveSearchAdStudy,ShouldSupportSearchResultAds<BraveSearchAdStudy,SplitHostCacheByNetworkIsolationKey<PartitionConnectionsByNetworkIsolationKeyStudy,UserActivity<UserActivityStudy" --disable-features="BraveAdblockDefault1pBlocking<Default1pBlockingStudy,BraveCleanupSessionCookiesOnSessionRestore<BraveCleanupSessionCookiesOnSessionRestore,BraveEnableAutoTranslate<BraveAutoTranslateStudy,BraveGoogleSignInPermission<BraveGoogleSignInPermissionStudy,ClampPlatformVersionClientHint<ClampPlatformVersionClientHint,ComputePressure<ForceDisableBlinkFeatures,IdleDetection<ForceDisableBlinkFeatures,NavigatorPluginsFixed<ForceDisableBlinkFeatures,SignedExchangeSubresourcePrefetch<ForceDisableBlinkFeatures,SmilAutoSuspendOnLag<SmilAutoSuspendOnLagKillSwitch,TextFragmentAnchor<ForceDisableBlinkFeatures,WebNFC<ForceDisableBlinkFeatures,WebOTP<ForceDisableBlinkFeatures" --disable-field-trial-config


`

Also check 'Details' tabs when you look at speedometer2 results. In case of network level delays the first result of the row could be extremely low, that could major affect the final score.

Screenshot 2023-12-09 at 16 44 22

Freshly loaded run in a guest window. I've done so many Speedometer runs by now I would notice any network slowdowns on the first iteration. ;-)

Edit: And for reference here's a new 100 iterations run that I just did in a fresh profile via the "--user-data-dir=/tmp/clean_tmp_profile_1" switch:

Screenshot 2023-12-09 at 18 33 02

atuchin-m commented 11 months ago

@valynor

I just did that in my standard user profile (with extensions) and it crashed the tab at 1635/4800 iterations. Then I added "browserbench.org" to the trusted sites in uBlock Origin 1.54 (effectively turning off uBO for this domain) and it ran to 4800/4800 without issue (score 343). I then repeated this in a guest window and again 4800/4800, score 347. So it seems that uBlock Origin is causing the tab crashes and probably the slowdowns too when doing long Speedometer runs. The way I see it is uBO or other extensions are the primary reason of your low speedometer results. Please check your main profile with all the extension in disabled state (on brave://extensions). Making an "exception" via the extensions settings is definitely not enough, most extensions inject to a page first, then check the exception lists.

It also explains, why:

So I synced back my usual profile via sync chain ... still 350 score but I decided to test some more, this time in the default profile

Your got your extensions back and the results degraded.

I then repeated this in a guest window and again 4800/4800, score 347.

Do you have uBO enabled in the guest window? (Allow in Incognito)

valynor commented 11 months ago

@atuchin-m

I did some more testing with extensions on and off but it was inconclusive so I went back to creating a fresh temp profile with the command you told me and discovered this inexplicable behaviour:

  1. I made sure the profile in the /tmp/ directory was actually deleted
  2. "/Applications/Brave Browser.app/Contents/MacOS/Brave Browser" --user-data-dir=/tmp/clean_tmp_profile_1
  3. maximized the Brave window by option-double clicking on a corner
  4. pasting https://browserbench.org/Speedometer2.1/ into the URL bar
  5. running Speedometer 2.1 and getting the good score (~430)
  6. clicked "Test Again" several times, score stays good

Now this is where it gets really weird:

  1. I opened a guest profile from the Menu > More Tools > Open Guest Profile
  2. I closed this Guest Window after a few seconds without doing anything in the window
  3. I re-ran Speedometer from the still open tab in the default tmp profile: ~350 score and it does not go back up anymore even if I run it repeatedly

This happens EVERY time, 100% reproducibly. I hope you can reproduce this on your devices, too.

I can create a screen capture if you would like to see it for yourself.

I have no idea what Brave is doing when I just open a Private/Guest Window but something is clearly very wrong here with the ARM64 version's performance on macOS Sonoma 14.1.2 with a M1 Max.

The loss of Speedometer performance described above is exactly what I am seeing on my real profile but in a Guest Profile Window with no extensions loaded (uBO is not running in my Guest Profile Window).

atuchin-m commented 11 months ago

@valynor The steps are interesting, but I can't reproduce the bug on my m1 pro MBP. I will ask colleagues tomorrow.

There is a "feature" in the profile subsystem: once you open another profile (including a guest one), it stays in an active state until you close the browser. It explains why a closed guest window could affect the primary profile.

  1. Could you also try to repeat the test by adding --disable-brave-extension to the command line?
  2. Please share the in-browser Task Manager screenshot at step 8. (menu -> more tools -> task manager) 
  3. Let's record the performance traces: go to brave://tracing in another tab, start recording (see the screenshot), reproduce the good speedometer2 run, stop recording, and download the file. Then repeat the same for the "bad" result. Then share both files. Not: You will get a lower score, but it should be enough to catch the difference. Chromium instructions for the references: https://www.chromium.org/developers/how-tos/submitting-a-performance-bug/
  4. The screencast will also help.
Screenshot 2023-12-13 at 01 15 12
valynor commented 11 months ago

@atuchin-m

  1. Could you also try to repeat the test by adding --disable-brave-extension to the command line?

I tried, no difference. BTW: I updated to Sonoma 14.2.

  1. Please share the in-browser Task Manager screenshot at step 8. (menu -> more tools -> task manager)

task manager after bad score

Fun fact: while doing the task manager screenshot I discovered that simply opening the task manager window and closing it a couple seconds later will also give me the bad scores until I restart Brave.

  1. The screencast will also help.

https://drive.google.com/file/d/1jmjCqpQme02BbfPQBze4k5YJnyugxBTW/view?usp=sharing

I will upload the requested traces later in a separate post.

1/2

valynor commented 11 months ago

2/2

Good score: https://drive.google.com/file/d/1WI_0LOK8JcFRbuBmySuHDJHiMoKjAODe/view?usp=drive_link

Bad score: https://drive.google.com/file/d/16yUf1MH4eBI_-cHofgrebdGa2anjAkjp/view?usp=drive_link

Really hope this helps you finding out what's going on.