menhera-org / TabArray

Chrome-like tab groups using private and isolated containers: The ultimate tab manager and groups for Firefox.
https://addons.mozilla.org/firefox/addon/container-tab-groups/
GNU General Public License v3.0
125 stars 5 forks source link

Improve switch timings between collapsed groups #196

Closed maverick74 closed 1 year ago

maverick74 commented 1 year ago

Describe the bug Presently, if a user has lots of open tabs (e.g.: >100) switching between collapsed groups takes some time loading the collapsed group. As a suggestion i would like to ask to improve this time

To Reproduce Steps to reproduce the behavior:

  1. create 2 groups each with a "many" tabs
  2. collapse group2
  3. load group2
  4. collapse group1
  5. load group1
  6. GO TO 2 (<-- yeah that's a Sinclair BASIC command! I'm THAT old! ahah XP)

Expected behavior Tabs have a delay/Lag in hidding and showing up. The switch should not have delays and tabs should load "instantly"

Additional context (This is more of a "control" issue to implement improvements asap as i'm aware the problem is (/was?) mostly on the Firefox side: https://github.com/kesselborn/conex/issues/215 )

metastable-void commented 1 year ago

Thank you for reporting.


Performance has been the most prominent problem of this extension for a while. There are many different problems related to performance. Some are coming from the nature of WebExtensions APIs and Firefox. Some are coming from incomplete implementation of the extension. Nevertheless I will continue to improve performance of the extension. For example, tab sorting is faster up to 100x (when we have hundreds of tabs) since 11.6.0 release. We are also planning to improve rendering of popup (#174). Our resource is limited, so user voices are an important factor when deciding what to implement first.

metastable-void commented 1 year ago

When listeners are registered for tab hidden/visible status changes, if we hide or show a loto of tabs, those listeners are called for each of the tabs. So if one extension (this extension or any one) registers a heavy listener, tab hiding/showing becomes very slow.

metastable-void commented 1 year ago

So one thing I can do is to reduce heavy operations on listeners.

maverick74 commented 1 year ago

But, from what i understood from some interactions with Conex and other similar extensions the Hide/Show performance of a tab is a Firefox problem mostly, no?

I mean, all addons that manage tab groups and have show/hide feature suffer from this tremendous lag.

The situation can already be fixed (it's probably a couple of years or more since i got this info), but if i remember correctly it was something about the way firefox handles "that" many tabs

metastable-void commented 1 year ago

Yes, it is sort of Firefox problem in the meaning that the problem is not fixable just by our effort, and that the API is far from ideal.

maverick74 commented 1 year ago

@metastable-void are you aware of any bug report concerning this API "problem"?

metastable-void commented 1 year ago

@metastable-void are you aware of any bug report concerning this API "problem"?

No, I do not know one. Possibly submitting one is of worth.

metastable-void commented 1 year ago

Currently in popup page we make a full snapshot of browser state every time any changes in tabs occur. This is not optimal, I think.

JohnLGalt commented 1 year ago

If a bug is submitted, please share it here so I can upvote it as well, and follow.

My previous profiles in both Fx Stable and Fx Nightly were getting a bit ... unwieldy, and were getting rather slow, especially in stable, when opening new tabs swapping between containers, and more. Since I experienced a completely different glitch which I also reported (in the discussions), I assumed all of the slow-down was due to my glitch, and am only just now seeing this.

I can report that a brand new profile in both Stable and Nightly has improved things rather dramatically, but I've only populated about ~50 or so tabs in both profiles, so I'll keep trying to populate more in both until I get close to / exceed 100 and see if it starts acting slowly again.

metastable-void commented 1 year ago

Could you guys test this new (unsigned) build?

ctg-11.8.0-1683370520-9fbcd6f.xpi.zip

This new version does not have heavy operations on listeners, and it makes a small delay in rendering the sidebar/popup, to improve overall performance. Container display now has a small delay, but actual hiding/showing containers should be faster.

It should improve situations for this problem and #198 too.

metastable-void commented 1 year ago

Ok, this build has a minor bug which causes the sidebar to display every tab ever selected as "active".

metastable-void commented 1 year ago

Ok, this build has a minor bug which causes the sidebar to display every tab ever selected as "active".

ctg-11.8.0-1683373056-1910788.xpi.zip

This is the fixed version.

metastable-void commented 1 year ago

Following is the latest version with minor bugs fixed.

ctg-11.8.0-1683473442-8fee94a.xpi.zip

JohnLGalt commented 1 year ago

Sorry, I was unavailable yesterday. I'll test this latest today.

I'll use a new profile again in Stable to test it SxS with my current (new) profile.

JohnLGalt commented 1 year ago

OK, in a new profile that is a virtual duplicate of my current new profile in Firefox stable, with the same containers, same tabs, and same NoScript settings and ForgetMeNot settings for each URL, and about 24 URLs in total, the new 11.8.0-1683473442 is almost 3x times faster in loading web pages, and swapping between focused containers / focusing different containers is anywhere from 2x to 5x faster.

Not a joke - it is tremendously faster, and I can load web pages at the same speed as in a Chrome Guest profile with no logins / addons.

Whatever changes you made in the listeners, they are definitely working.

However, creating a new container seems to take a quite a bit of time. But since I rarely create new containers, it's not that big of a deal. But it is if someone uses temporary containers a lot.

I've now added the test build to my original profile in Firefox Stable, replacing the released v11.7.0 and I'm seeing the same speed benefits there as well.

And note, both the original profile as well as only have 24 tabs, net even close to 100, and the slow down was quite apparent with 11.7.0.

I was only able to test in Fx Stable, as Fx Nightly requires signed addons.

metastable-void commented 1 year ago

In Nightly, setting xpinstall.signatures.required to false in about:config should make unsigned addons installable. Also, temporary addons from about:debugging should always be installable.

metastable-void commented 1 year ago

However, creating a new container seems to take a quite a bit of time. But since I rarely create new containers, it's not that big of a deal. But it is if someone uses temporary containers a lot.

I have the same issue here. Created containers do not appear at sidebar soon. I should fix this before release.

metastable-void commented 1 year ago

I have the same issue here. Created containers do not appear at sidebar soon. I should fix this before release.

Fixed in https://github.com/menhera-org/TabArray/commit/ce340055ac6cf9bf2d4a753545d1b43cf038d879.

metastable-void commented 1 year ago

ctg-11.8.0-1683534268-87c9568.xpi.zip

This is a new version with several related bugs fixed.

JohnLGalt commented 1 year ago

I added the new version to my test profile and the issues with container creation are definitely fixed, while the responsiveness of tabs and switching containers has not diminished any.

Thanks!

metastable-void commented 1 year ago

ctg-11.8.0-1683564905-3c466dd.xpi.zip

I just created an experimental build using Parcel as a bundler, instead of WebPack. If this is not broken in any way, I would like to merge experiment-with-parcel into main.

JohnLGalt commented 1 year ago

I'll test it in the test profile first. Since I have the previous build in the regular profile, I can compare them SxS and see if there is anything off.

JohnLGalt commented 1 year ago

Haven't found anything broken yet. All the issues listed above are non-existent (still fixed) in this parcel build.

Running in the test profile on Fx Stable, the default profile on Fx Stable and the default profile on Fx Nightly.

maverick74 commented 1 year ago

I'm sorry for not testing it earlier (other things got in the way... )

First: THANK YOU!!! @metastable-void

There's one thing, however, i don't know how it should be deal with:

A container that has just one tab which happens to be pinned. This "Container Tab" should also be hidden because if not, when one selects it, it somehow passes to the next...

Is this doable? Does it makes sense?

(sorry for such a short description... I'm in a hurry)

metastable-void commented 1 year ago

Hiding pinned tabs is not possible, and for this reason we handle pinned tabs differently.

maverick74 commented 1 year ago

Hiding pinned tabs is not possible, and for this reason we handle pinned tabs differently.

I didn't explain correctly. Sorry. I don't want to hide pinned tabs!

I'll put it in other words:

  1. Open a tab in, say, msn.com.
  2. Put that tab in a group/container named "News"
  3. It's the only tab on that container.
  4. Now Pin that tab

Result: You now have a pined tab (on the left of tabs bar) And you also have the "Container Tab" on the tabs bar that does not have any tab associated with it (except for the pinned tab on the lef) So... i have a container tab with no tabs AFTER it.

Desired Result: IF the tabs associated to a Container/Group are all pinned, I think it makes no sense in having an empty Container Tab on the tabs bar as such, i think it would make sense to hide that Container Tab (not the pinned tabs! Just the Container Tab!) until there are normal tabs associated with it

metastable-void commented 1 year ago

I got it. It makes no sense in leaving an index tab for this situation, and it seems to be a bug. I look for a solution.

metastable-void commented 1 year ago

I got it. It makes no sense in leaving an index tab for this situation, and it seems to be a bug. I look for a solution.

ctg-11.8.1.101-1683806033-5e3995a.xpi.zip

This is the fixed version.

metastable-void commented 1 year ago

Fix released as 11.8.1 (11.8.1.201).

maverick74 commented 1 year ago

@metastable-void I'm sorry... there's something terribly wrong (i was only able to test it today!).

The latest version closed all my tabs except for the pinned ones (thanks... i needed to clean them, anyway) i can't move a tab to a new container as it closes it...

metastable-void commented 1 year ago

Could you export a "Debugging Information" file and upload it here? (Please zip it before uploading)

Also, do you have the "Index Tabs" feature enabled?

maverick74 commented 1 year ago

Could you export a "Debugging Information" file and upload it here? (Please zip it before uploading)

Yeah... But only next Monday... I'm out of the office.

Also, do you have the "Index Tabs" feature enabled?

I believe so. About 99% sure... But I'll check that 1% unsure next week ;)

metastable-void commented 1 year ago

Debugging information is cleared on restart, so we need that information for the session the problem happened.

maverick74 commented 1 year ago

Debugging information is cleared on restart, so we need that information for the session the problem happened.

Oh. That's not available anymore, then. It's gone for sure.

But I'll try to replicate it :)