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

beachball/perf hit after importing many tabs from muon #2374

Closed
LaurenWags opened this issue Dec 5, 2018 · 3 comments · Fixed by brave/brave-core#1038
Closed

beachball/perf hit after importing many tabs from muon #2374

LaurenWags opened this issue Dec 5, 2018 · 3 comments · Fixed by brave/brave-core#1038

Comments

@LaurenWags
Copy link
Member

Description

Found while testing #998

If you have a bunch of tabs on muon (I used 4 windows with 100ish tabs per window), and import those to b-c, you'll see that the import completes as expected. However, after getting the completion box, I beachballed for a bit and then my CPU went up and my laptop fans kicked on. It looks like all tabs are attempting to load at once.

This only happens after the import. Subsequent launches of Brave do not have this problem (tabs aren't loaded until you click on them).

Steps to Reproduce

  1. Have a muon profile with several windows and many tabs.
  2. Close muon.
  3. Launch b-c (if you don't launch with --upgrade-from-muon flag then you'll have to import your data manually.
  4. Import data manually if necessary.
  5. Wait for UI notification that import was successful.

Actual result:

See beachball and then notice CPU go up as all tabs attempt to load at once.
screen shot 2018-12-05 at 3 13 28 pm

screen shot 2018-12-05 at 3 14 57 pm

Expected result:

No CPU increase, would be nice if maybe tabs were lazy loaded/staggered on load.

Reproduces how often:

easily

Brave version (brave://version info)

Brave 0.57.16 Chromium: 71.0.3578.80 (Official Build) (64-bit)
Revision 2ac50e7249fbd55e6f517a28131605c9fb9fe897-refs/branch-heads/3578@{#860}
OS Mac OS X

Reproducible on current release:

  • Does it reproduce on brave-browser dev/beta builds?

Website problems only:

  • Does the issue resolve itself when disabling Brave Shields?
  • Is the issue reproducible on the latest version of Chrome?

Additional Information

cc @rebron @garrettr @bsclifton @kjozwiak

@kjozwiak
Copy link
Member

kjozwiak commented Dec 5, 2018

Ran into the same thing when going through the case @LaurenWags mentioned in Slack.

macOS Results:

importingtabswindows

For the above example, I imported 4 windows that had 150 tabs each. Once b-c is launched and the 4 windows are restored, b-c will attempt to load every single tab which took about ~20min. When this is happening, the browser becomes pretty unresponsive. At the same time, it also causes major performance issues with the OS itself and other applications start slowing down as b-c is consuming most of the resources. While the tabs were being loaded, my Slack was really hard to use.

Windows 10 x64 Results:

migratingtabswindows

unresponsiveerror1

unresponsiveerror2

Because the Windows 10 x64 machine is a lot more powerful than the macOS (MBP), b-c was pretty responsive up until I started moving the windows around. Once I moved a few windows, all the windows started becoming unresponsive and I started getting Application not responsive errors. When this was happening, I tried to see how responsive b-c was and attempted to open a Private Window which ended up crashing the browser:

@kjozwiak
Copy link
Member

kjozwiak commented Dec 5, 2018

We should be importing all the tabs but only load them once a user focuses on a particular tab. Basically the same thing we do when restoring sessions. This will mitigate the above issues for users who might be importing a lot of tabs/windows.

Even though the above examples are extreme cases, anyone with a moderate amount of tabs will run into these performance issues while we're loading tabs.

@LaurenWags
Copy link
Member Author

LaurenWags commented Dec 6, 2018

Verified passed with

Brave 0.57.18 Chromium: 71.0.3578.80 (Official Build) (64-bit)
Revision 2ac50e7249fbd55e6f517a28131605c9fb9fe897-refs/branch-heads/3578@{#860}
OS Mac OS X

Went through verification using the following build under macOS 10.14 x64 - PASSED [@kjozwiak]

Brave 0.57.18 Chromium: 71.0.3578.80 (Official Build) (64-bit)
Revision 2ac50e7249fbd55e6f517a28131605c9fb9fe897-refs/branch-heads/3578@{#860}
OS Mac OS X
  • imported a profile from muon that includes 4 windows with 150 tabs each and ensured it imported without any performance issues
  • ensured that the profile was lazy loaded when imported into 0.57.18 Chromium: 71.0.3578.80
  • ensured that 0.57.18 Chromium: 71.0.3578.80 was usable when the profile was migrated over
  • ensured that only the active tabs were loaded when importing and the remaining were lazy loaded
  • ensured that clicking on a tab loaded the website/content without issues/performance issues
  • closed the 4 imported windows and restored them using History -> Recently Closed and ensured there wasn't any performance issues
  • closed and restored Brave a few times and ensured it lazy loaded the profile

Verification passed on

Brave 0.57.18 Chromium: 71.0.3578.80 (Official Build) (64-bit)
Revision 2ac50e7249fbd55e6f517a28131605c9fb9fe897-refs/branch-heads/3578@{#860}
OS Linux
  • Verified all windows from muon got imported
  • Only the active tab on all windows were loaded, none of the other tabs were loaded
  • Import was instant and no high CPU/Memory usage
  • Original window on 0.57.18 was still usable
  • Loading other tabs on other windows didn't increase CPU/Memory usage
  • Closed the 4 imported windows and restored them using History -> Recently Closed and ensured there wasn't any performance issues

Verification Passed on

Brave 0.57.18 Chromium: 71.0.3578.80 (Official Build) (64-bit)
Revision 2ac50e7249fbd55e6f517a28131605c9fb9fe897-refs/branch-heads/3578@{#860}
OS Windows
  • Verified all windows from muon got imported
  • Only the active tab on all windows were loaded, none of the other tabs were loaded
  • Import was instant and no high CPU/Memory usage
  • Original window on 0.57.18 was still usable
  • Loading other tabs on other windows didn't increase CPU/Memory usage
  • Closed the 4 imported windows and restored them using History -> Recently Closed and ensured there wasn't any performance issues

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