Laggy performance with very big sessions on Firefox after upgrading to MV3
Short description
Upgrading from 6.12.2 to 7.0.0 result in severe lags while quickly closing tabs or quickly pressing undo/redo in TSM's sessions window in Firefox with a very big session (Chromium isn't affected)
Steps to reproduce
- Start Firefox browser with clean profile
- Install Tab Session Manager
- Create a session with maybe 100 tabs of Wikipedia
- Quickly closes those tabs in TSM's session window.
Expected result
Should process smoothly.
Actual result
TSM becomes very laggy. It even takes a long time for TSM popup to load if you exit click the popup again.
Platform information
- Platform (OS): Windows 10
- Version of browser: 129.0
- Version of Tab Session Manager: 7.0.0 and 7.0.1
Additional context
Seems like a memory leak/high CPU usage.
6.12.2: Quickly closing tabs
https://github.com/user-attachments/assets/93b3072b-8f03-4ec5-8b9d-3aca27854645
7.0.1: Quickly closing tabs
https://github.com/user-attachments/assets/1f10fc1f-5307-4bc1-b2ed-217a7e742d7f
Have you tried profiling the Extensions process?
Have you tried profiling the Extensions process?
I have tried here: https://share.firefox.dev/46Mopjt I can kind of see where things are going wrong but I'm not a webdev at all...
I found this.removeTab in the flamegraph found on line 592 in ./src/popup/components/PopupPage.js
You can try git bisect to find the commit that introduced the issue.
Actually it may be an upstream issue, I tried mozregression and got a range of 2023-05-15-21-56-23 to 2023-05-16-04-24-30, which seems to correspond to this range in the source. I'll probably go submit a bugzilla
Update: It's probably an upstream issue - as there is only one commit on ./src/popup/components/PopupPage.js inbetween v6 and v7, and reverting the commit didn't work.
If sienori can look into the profiler a bit and confirm it's upstream then I will close the issue.