Tab Switch Performance with many tabs
-
@Pathduck I have 4GB RAM available(out of 8GB), Vivaldi probably consumes 2GB at most. Closing a window with 99 tabs but only 3 active tabs gives me merely 200 MB back.
I see 150 MB I/O spike with opening a new tab but it is true with 64 tabs as 163 tabs. I have only 7 speed dials.
Investigating this, I found The Great Discarder causing the spike.
Note that the problem is still originally with the number of tabs. I will investigate further to see if there is an improvement.
-
I have that problem also. I have around 50 tabs and when I switch from one tab to another it freezes for about 1-2 seconds - I can move mouse cursor, but the page does not respond/scroll. I have another computer where 150 tabs is opened and it much worse there.
I tried to disable all extensions, create new profile, nothing helped. At first it could be better, but then it slows down again.
So I opened 60 tabs in new clean profile and tried to debug Vivaldi application and it looks like every time I change a tab Vivaldi sends some message to all other tabs, each call takes 20-60ms and that is 1-2 seconds in total. Why is this so? Is there a room for improvement? If some developer could comment it would be great.
I attached Javascript Profiler screenshots and the profile itself. The profile is created when I just switched from one tab to another.
Profile-20210211T210009.zip
-
@Pathduck
333 tab open, about 30 active. Eats 3.5 Gb of memory out of 32Gb. After last update started lagging in anything to do with tabs. Open, close, switch, active search help. Gets even worse when using hotkeys or mouse gestures. Previously was working fine with tabs up to 700. -
I'm also observing tab switch issues. With 300 tabs open, after restarting Vivaldi and 2 tabs active (lazy loading), there was a 20-30s freeze when switching between them.
But I noticed something interesting: For me the problem is related to vertical tabs. The freeze after switching tabs was completely gone when using horizontal tabs.I confirmed this with a new (standalone) install of Vivaldi 3.6.2165.36 by opening 80 start page tabs and one tab with a simple page (tried several, doesn't make a difference). When either the window plane is active or the tab bar position is left or right, switching from a start page to the simple page causes a 2-4s freeze. With the tab bar position top or bottom, and the window plane not active/shown, the freeze is gone. Where I click to switch tabs (tab bar or window plane) doesn't make a difference, and the behavior is the same when using keyboard shortcuts to switch tabs.
I was able to replicate this with 3.6.2165.34, but not with 3.5.2115.87.
EDIT: Sorry, just now saw https://forum.vivaldi.net/topic/56228/3-6-2165-34-vivaldi-freezes-when-switching-or-opening-closing-tabs, I'll post there.
-
@dorned I use horizontal tabs and it does not help.
-
While we're waiting for a fix I've tried to fix it myself. And it works pretty good, it could be better, I believe, if Vivaldi developers would take a look, but for now I can enjoy using all my tabs again. For those who want to experiment here is what I did. I added this code into
bundle.js
, it skips most of the tab update events and I don't see any side effects:if (!a.active && t.extData && Object.keys(t).length == 1) { const d = JSON.parse(t.extData); if (!window.tabsState) window.tabsState = {}; if (!window.tabsState[e]) window.tabsState[e] = {}; let changed; for (let k in d) { if (d[k] !== window.tabsState[e][k]) { changed = Object.assign(window.tabsState[e], d); break; } } if (!changed) return; }
I attached the updated file for Vivaldi 3.6.2165.36, steps to apply the change:
- make sure you have same Vivaldi version
- backup the current tabs as a sessions
- close Vivaldi
- make a backup of file
c:\Users\<username>\AppData\Local\Vivaldi\Application\3.6.2165.36\resources\vivaldi\bundle.js
and replace it with the attached one (don't forget to unpack it) - try it and write a comment here
Update: changed the code to fix a tab stack issue.
-
@Hababr You can do a bug report with your fix linked/attached.
Is still a performance bug after all and devs will find that in the tracking system -
@Hadden89 Probably I will. But I don't want to wait for a fix for months, I want to use my browser now. And I think only a small number of users have so many tabs.
Update: reported as VB-76959.
-
@Hababr said in Tab Switch Performance with many tabs:
bundle.zip
this file has been deleted. could you upload it up again?
-
@cOAPerator Thanks, I've updated the link.
-
@Hababr plus is with an updated bundle
zero effect. Feels like it also slows down and slows down
checked for stable and dev versions of the latest -
@cOAPerator What do you want to see in task manager. I changed the file for the latest stable version 3.6.2165.36 only.
-
@Hababr i tested on the latest stable version too
I thought that memory consumption would decrease, since there are fewer calls between tabs -
@cOAPerator It's nothing to do with memory consumption. My change allows me to switch tabs faster.
-
@Hababr I already got it. but it still has no effect. tabs open with a delay of 1-2 seconds
-
@Hababr works faster without freezes, thanks!
-
Thanks @Hababr ! I am using 3.6.2165.40 (latest stable) and the workaround still works.
After "beautifying" the current version of bundle.js and adding that code snippet, it works like a charm.
I knew it had something to do with the large amounts of tabs I use (currently 181 as I write). The obvious answer was using sessions and working with just a few tabs, but it felt quite uncomfortable -- that is not the way I am accustomed to work with Vivaldi. -
@underscore I'm glad it helped you. I like to open a lot of tabs too. Now I use the latest snapshot and it works much better (it can be installed on top of stable).
-
Ppafflick moved this topic from Vivaldi for Windows on