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

Fix stutters for unsynchronized loading throbbers #3269

Merged
merged 1 commit into from Jan 5, 2023

Conversation

Lej77
Copy link
Contributor

@Lej77 Lej77 commented Dec 27, 2022

I noticed that the loading throbber animation seemed to stutter a lot when it was started. After some testing I found that this only occurred for unsynchronized throbbers. See how the bottom 5 tabs in the GIF below compares to the synchronized tabs at the top of the GIF:

loading animation

I remembered #1703 and investigated whether transparency was the problem again. Currently the background throbber is always transparent so I added some custom CSS to disable that transparency:

#dummy-tabs {
    clip: unset !important;
}

After that the animations no longer stuttered so that seems to fix the issue. I did some performance testing and unfortunately the change caused higher CPU usage. To minimize this disadvantage the PR makes the background throbber transparent as soon as there are no unsynchronized throbbers. Since the throbbers are only unsynchronized for a short time then maybe the higher CPU usage is worth it for the smoother animations?

Performance

To easier observe CPU usage of loading tabs I create infinitely loadings tabs using the same method I used in issue #1703.

  1. Start Firefox with clean profile.
  2. Install TST.
  3. Open about 200 new tabs (hold ctrl+t) and wait for them to finish loading.
  4. Download "iperf-2.0.9-win64" and run the program with the command iperf.exe -s -p 8888.
  5. Open 10 infinitely loading tabs by entering the following URL: localhost:8888.
  6. Scroll so that tabs are not visible in native tabbar.
  7. Scroll so that the loading tabs are visibile in the sidebar.
  8. Observe Firefox CPU usage.
  9. Scroll so that the loading tabs are not visibile in the sidebar.
  10. Observe Firefox CPU usage.

I repeat all these steps for 3 different scenarios:

  • Invisible: the background loading thobber is transparent.
    • This is the case if no custom CSS is applied to the current TST version.
  • Shown: the background loading throbber is never transparent but is still hidden behind the sidebar background element.
    • This is the case if the following CSS is applied to the sidebar:
#dummy-tabs {
    clip: unset !important;
}
  • Dynamic: the background loading throbber is transparent if all throbbers are synchronized.
    • This is the case if this PR is applied.

CPU usage when all throbbers are unsynchronized

To test this I disabled synchronization with the following css:

/* Never sync loading throbbers */
#sync-throbber {
  animation: unset !important;
}
Invisible Shown Dynamic (Same as Shown)
Scrolled into view 4-6% 19% 19%
Scroll out of view 2% 14% 14%

CPU usage when all throbbers are synchronized

Invisible Shown Dynamic (Same as Invisible)
Scrolled into view 6-8% 5-7% 6-8%
Scroll out of view 2-3% 4-6% 2-3%

Environment

  • Platform (OS): Windows 10
  • Version of Firefox: 108.0.1
  • Version (or revision) of Tree Style Tab: 3.9.11

@piroor piroor merged commit 43da2ac into piroor:trunk Jan 5, 2023
@piroor
Copy link
Owner

piroor commented Jan 5, 2023

Thanks a lot!

@Lej77 Lej77 deleted the patch-3 branch January 5, 2023 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants