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

[Bug] 4.0.15 hangs on ESR #3557

Open
DarthGandalf opened this issue May 21, 2024 · 10 comments
Open

[Bug] 4.0.15 hangs on ESR #3557

DarthGandalf opened this issue May 21, 2024 · 10 comments

Comments

@DarthGandalf
Copy link

DarthGandalf commented May 21, 2024

Abstract

Since today TST is unusable on FF ESR 115.10.0 on Linux 64bit. It uses 400% CPU, and is either very slow, or just never successfully loads anymore, instead keeping blinking between showing progress bar and not showing. I tried to restart firefox several times, that's how having different results.

I see this in browser console

Key ext-key-id-treestyletab_piro_sakura_ne_jp-sidebar-action of menuitem Tree Style Tab could not be found menu.js:289:19
    accelText chrome://global/content/elements/menu.js:289
    _computeAccelTextFromKeyIfNeeded chrome://global/content/elements/menu.js:296
    render chrome://global/content/elements/menu.js:323
    <anonymous> chrome://global/content/elements/menu.js:170
AbortError: Actor 'Conduits' destroyed before query 'RunListener' was resolved
sendRemoveListener on closed conduit treestyletab@piro.sakura.ne.jp.5772436050333 ConduitsChild.sys.mjs:108
    _send resource://gre/modules/ConduitsChild.sys.mjs:108
    removeListener resource://gre/modules/ExtensionChild.sys.mjs:675
    removeListener resource://gre/modules/ExtensionChild.sys.mjs:940
    register chrome://extensions/content/child/ext-storage.js:175
    removeListener resource://gre/modules/ExtensionCommon.sys.mjs:2869
    revoke resource://gre/modules/ExtensionCommon.sys.mjs:2891
    close resource://gre/modules/ExtensionCommon.sys.mjs:2896
    unload resource://gre/modules/ExtensionCommon.sys.mjs:979
    unload resource://gre/modules/ExtensionPageChild.sys.mjs:282
    unload resource://gre/modules/ExtensionPageChild.sys.mjs:319
    destroyExtensionContext resource://gre/modules/ExtensionPageChild.sys.mjs:479
    observe resource://gre/modules/ExtensionPageChild.sys.mjs:388

I downgraded to 4.0.14 for now, and it works fine.

Steps to reproduce

  1. Have >1000 tabs
  2. Do nothing
  3. Let TST extension automatically update to 4.0.15

Expected result

Actual result

Environment

  • Platform (OS): linux
  • Version of Firefox: 115
  • Version (or revision) of Tree Style Tab: 4.0.15
@DarthGandalf DarthGandalf changed the title [Bug] (please put summary here) [Bug] 4.0.15 hangs on ESR May 21, 2024
@piroor
Copy link
Owner

piroor commented May 23, 2024

I've tried TST 4.0.15 + Firefox ESR 115.11.0 on Ubuntu 22.04 (on VirtualBox) but couldn't reproduce such a hanging. Could you collect a performance profile?
https://github.com/piroor/treestyletab/wiki/How-to-inspect-tree-of-tabs#how-to-collect-a-performance-profile

@DarthGandalf
Copy link
Author

Not sure what has changed since yesterday, but it managed to load at all today, though slow. It's still 4.0.15

Firefox 2024-05-23 12.13 profile.json.gz

@piroor
Copy link
Owner

piroor commented May 23, 2024

Thanks, I've realized that a change introduced to follow Firefox's change https://bugzilla.mozilla.org/show_bug.cgi?id=1897595 triggers the problem.

@emilio
Copy link
Contributor

emilio commented May 23, 2024

The issue is that you're synchronously determining the overflow state on connectedCallback(), the right thing to do is to just let the ResizeObserver callback be invoked once (it will be), or use requestAnimationFrame to batch the initial observations.

@piroor
Copy link
Owner

piroor commented May 23, 2024

@emilio Hmm, the initial "overflow" state is required to know when the state is actually changed, so the synchronous operation

let lastOverflow = (
looks still required... and of course I already throttled detecting "overflow" state on every observations.
window.requestAnimationFrame(() => {

I can give up to determine the initial state but it looks to mean the initial resizing will be detected as "overflow" or "underflow" here

if (overflow === lastOverflow)
regardless the element's overflow state is actually changed or not.

@piroor
Copy link
Owner

piroor commented May 23, 2024

Anyway this throttling may be effective to reduce needless style computations for tab elements inserted to the DOM tree and immediately removed by quick scrolling.
12359f7
@DarthGandalf Could you try the latest development build? https://github.com/piroor/treestyletab?tab=readme-ov-file#development-builds

@DarthGandalf
Copy link
Author

I didn't really measure time, so can't compare whether it's faster than before. It at least finished loading, unlike yesterday :)

Firefox 2024-05-23 16.01 profile.json.gz

@gotyaoi
Copy link

gotyaoi commented May 23, 2024

I had noticed a performance degradation (specifically when scrolling up in the list of tabs) on 4.0.15 (firefox 126, windows 11). The development build makes it much better, though perhaps slightly slower than before 4.0.15.

@piroor
Copy link
Owner

piroor commented May 25, 2024

With the commit 07bed44 now TST uses overflow/underflow events instead of ResizeObserver again if those events are available. Performance regression reported at here will go away until Firefox 128, but it is not a fundamental solution.

@jayywolff
Copy link

jayywolff commented Jun 5, 2024

ive been able to reproduce this issue as well with only 70 tabs

on
Arch Linux x86_64
Firefox 126.0.1
TST 4.0.15

edit, i bookmarked my tabs, closed all of them, even cleared all site cookies/data.
and now even with just a single tab open here on github, TST just hangs and doesnt load at all.
Just showing a loading bar (that appears to be about 20% complete) and flickers every 10-15 seconds.

edit 2: found a workaround after struggling with this for a few days:

  • bookmark all your open tabs into a folder
  • downgrade to TST 4.0.14
  • disable auto-updates for TST
  • go to Firefox Settings -> General -> Startup
  • uncheck "Open previous windows and tabs"
  • restart firefox
  • Now TST should be working 😄
  • go to Firefox Settings -> General -> Startup
  • check "Open previous windows and tabs"
  • now restore your bookmarks folder if needed

@piroor looks like you added backward compatibility as a workaround already, when can we expect a TST update including 07bed44

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

No branches or pull requests

5 participants