RealRaven2000 / QuickFolders

Thunderbird Add-on: QuickFolders
http://quickfolders.org/
Other
49 stars 9 forks source link

On startup, updateFolders is called too often, make this more efficient #487

Open RealRaven2000 opened 3 months ago

RealRaven2000 commented 3 months ago

When starting up THunderbird (especially when there is a lot of processing syncing due to IMAP updates) I see a lot of activitiy of QuickFolders updating its tabs / menus within a short time. I suspect that this may have some impact on performance. We need to add some metrics on how long this actually takes but there are definitely multiple calls within a window of 5 seconds. Here is a collation of all calls within the startup window. there may be some scope for improvement.

QuickFolders 10:38:7.727  [1 ms]   
 updateFoldersUI()... quickfolders-util.js:1301:13
QuickFolders 10:38:7.728  [1 ms]   
 updateFolders(rebuildCategories: true, minimal: false) - Number of Folders = 258 quickfolders-util.js:1301:13
QuickFolders 10:38:8.122  [1 ms]   
 updateFoldersUI()... quickfolders-util.js:1301:13
QuickFolders 10:38:8.123  [1 ms]   
 updateFolders(rebuildCategories: true, minimal: false) - Number of Folders = 258 quickfolders-util.js:1301:13
QuickFolders 10:38:42.652  [32373 ms]   
 updateFolders(rebuildCategories: false, minimal: false) - Number of Folders = 258 quickfolders-util.js:1301:13
QuickFolders 10:38:45.773  [638 ms]   
 updateFolders(rebuildCategories: false, minimal: true) - Number of Folders = 258 quickfolders-util.js:1301:13
QuickFolders 10:38:47.97  [21 ms]   
 updateFolders(rebuildCategories: false, minimal: true) - Number of Folders = 258 quickfolders-util.js:1301:13
QuickFolders 10:38:47.916  [537 ms]   
 updateFolders(rebuildCategories: false, minimal: true) - Number of Folders = 258 quickfolders-util.js:1301:13
QuickFolders 10:38:55.911  [501 ms]   
 updateFolders(rebuildCategories: false, minimal: true) - Number of Folders = 258 quickfolders-util.js:1301:13
QuickFolders 10:38:58.131  [507 ms]   
 updateFolders(rebuildCategories: false, minimal: true) - Number of Folders = 258 quickfolders-util.js:1301:13
QuickFolders 10:40:56.379  [498 ms]   
 updateFolders(rebuildCategories: false, minimal: true) - Number of Folders = 258 quickfolders-util.js:1301:13
QuickFolders 10:47:48.817  [120 ms]   
 updateFolders(rebuildCategories: false, minimal: true) - Number of Folders = 258 quickfolders-util.js:1301:13
QuickFolders 10:47:57.882  [701 ms]   
 updateFolders(rebuildCategories: false, minimal: true) - Number of Folders = 258 quickfolders-util.js:1301:13
QuickFolders 10:48:11.827  [71 ms]   
 updateFolders(rebuildCategories: false, minimal: true) - Number of Folders = 258 quickfolders-util.js:1301:13
QuickFolders 10:48:19.600  [500 ms]   
 updateFolders(rebuildCategories: false, minimal: true) - Number of Folders = 258 quickfolders-util.js:1301:13
QuickFolders 10:48:36.320  [59 ms]   
 updateFolders(rebuildCategories: false, minimal: true) - Number of Folders = 258 quickfolders-util.js:1301:13
QuickFolders 10:48:53.192  [182 ms]   
 updateFolders(rebuildCategories: false, minimal: true) - Number of Folders = 258 quickfolders-util.js:1301:13
QuickFolders 10:49:9.137  [520 ms]   
 updateFolders(rebuildCategories: false, minimal: true) - Number of Folders = 258 quickfolders-util.js:1301:13
QuickFolders 10:49:18.73  [201 ms]   
 updateFolders(rebuildCategories: false, minimal: true) - Number of Folders = 258 quickfolders-util.js:1301:13
QuickFolders 10:49:33.691  [267 ms]   
 updateFolders(rebuildCategories: false, minimal: true) - Number of Folders = 258 quickfolders-util.js:1301:13
QuickFolders 10:49:49.204  [157 ms]   
 updateFolders(rebuildCategories: false, minimal: true) - Number of Folders = 258 quickfolders-util.js:1301:13
QuickFolders 10:50:3.930  [152 ms]   
 updateFolders(rebuildCategories: false, minimal: true) - Number of Folders = 258 quickfolders-util.js:1301:13
QuickFolders 10:50:18.839  [159 ms]   
 updateFolders(rebuildCategories: false, minimal: true) - Number of Folders = 258 quickfolders-util.js:1301:13
QuickFolders 10:50:26.659  [499 ms]   
 updateFolders(rebuildCategories: false, minimal: true) - Number of Folders = 258 quickfolders-util.js:1301:13
QuickFolders 10:50:34.73  [526 ms]   
 updateFolders(rebuildCategories: false, minimal: true) - Number of Folders = 258 quickfolders-util.js:1301:13
QuickFolders 10:50:48.380  [151 ms]   
 updateFolders(rebuildCategories: false, minimal: true) - Number of Folders = 258 quickfolders-util.js:1301:13
QuickFolders 10:51:3.482  [149 ms]   
 updateFolders(rebuildCategories: false, minimal: true) - Number of Folders = 258 quickfolders-util.js:1301:13
QuickFolders 10:51:18.556  [161 ms]   
 updateFolders(rebuildCategories: false, minimal: true) - Number of Folders = 258 quickfolders-util.js:1301:13
QuickFolders 10:51:33.301  [329 ms]   
 updateFolders(rebuildCategories: false, minimal: true) - Number of Folders = 258 quickfolders-util.js:1301:13
QuickFolders 10:51:48.994  [535 ms]   
 updateFolders(rebuildCategories: false, minimal: true) - Number of Folders = 258 quickfolders-util.js:1301:13
QuickFolders 10:51:56.946  [506 ms]   
 updateFolders(rebuildCategories: false, minimal: true) - Number of Folders = 258 quickfolders-util.js:1301:13
QuickFolders 10:52:4.921  [7494 ms]   
 updateFolders(rebuildCategories: false, minimal: true) - Number of Folders = 258 quickfolders-util.js:1301:13
QuickFolders 10:52:12.848  [7891 ms]   
 updateFolders(rebuildCategories: false, minimal: true) - Number of Folders = 258 quickfolders-util.js:1301:13
QuickFolders 10:52:14.751  [1732 ms]   
 updateFolders(rebuildCategories: false, minimal: true) - Number of Folders = 258 quickfolders-util.js:1301:13
QuickFolders 10:52:15.550  [100 ms]   
 updateFolders(rebuildCategories: false, minimal: true) - Number of Folders = 258 quickfolders-util.js:1301:13
QuickFolders 10:52:16.310  [452 ms]   
 updateFolders(rebuildCategories: false, minimal: true) - Number of Folders = 258 quickfolders-util.js:1301:13