Open DarthGandalf opened 1 month ago
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
Not sure what has changed since yesterday, but it managed to load at all today, though slow. It's still 4.0.15
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.
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.
@emilio Hmm, the initial "overflow" state is required to know when the state is actually changed, so the synchronous operation https://github.com/piroor/treestyletab/blob/9022cb07889cc5d5bcdd1341d01b32ad5027790d/webextensions/common/common.js#L994 looks still required... and of course I already throttled detecting "overflow" state on every observations. https://github.com/piroor/treestyletab/blob/9022cb07889cc5d5bcdd1341d01b32ad5027790d/webextensions/common/common.js#L1002
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 https://github.com/piroor/treestyletab/blob/bf09c9827836ac36c078f2a207fa1ac287961079/webextensions/common/common.js#L1007 regardless the element's overflow state is actually changed or not.
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. https://github.com/piroor/treestyletab/commit/12359f7eb868b789fbe11181b52f84dbb027af64 @DarthGandalf Could you try the latest development build? https://github.com/piroor/treestyletab?tab=readme-ov-file#development-builds
I didn't really measure time, so can't compare whether it's faster than before. It at least finished loading, unlike yesterday :)
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.
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.
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:
@piroor looks like you added backward compatibility as a workaround already, when can we expect a TST update including https://github.com/piroor/treestyletab/commit/07bed443317e7a7a6c998f5b6aef19c03e9dd9c2
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
I downgraded to 4.0.14 for now, and it works fine.
Steps to reproduce
Expected result
Actual result
Environment