From f200bbf5d5193931a16a38e69785d388be18fd68 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sat, 27 Jan 2024 07:22:32 -0500 Subject: [PATCH] Add trace information to console --- src/js/storage.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/js/storage.js b/src/js/storage.js index 0a01aaa6e..7123cb3d9 100644 --- a/src/js/storage.js +++ b/src/js/storage.js @@ -850,8 +850,7 @@ onBroadcast(msg => { let t0 = 0; const onDone = ( ) => { - const td = Date.now() - t0; - ubolog(`loadFilterLists() took ${td} ms`); + ubolog(`loadFilterLists() All filters in memory at ${Date.now() - t0} ms`); staticNetFilteringEngine.freeze(); staticExtFilteringEngine.freeze(); @@ -859,14 +858,16 @@ onBroadcast(msg => { vAPI.net.unsuspend(); filteringBehaviorChanged(); - vAPI.storage.set({ 'availableFilterLists': µb.availableFilterLists }); + ubolog(`loadFilterLists() All filters ready at ${Date.now() - t0} ms`); logger.writeOne({ realm: 'message', type: 'info', - text: `Reloading all filter lists: done, took ${td} ms` + text: `Reloading all filter lists: done, took ${Date.now() - t0} ms` }); + vAPI.storage.set({ 'availableFilterLists': µb.availableFilterLists }); + broadcast({ what: 'staticFilteringDataChanged', parseCosmeticFilters: µb.userSettings.parseAllABPHideFilters, @@ -882,6 +883,7 @@ onBroadcast(msg => { }; const applyCompiledFilters = (assetKey, compiled) => { + ubolog(`loadFilterLists() Loading filters from ${assetKey} at ${Date.now() - t0} ms`); const snfe = staticNetFilteringEngine; const sxfe = staticExtFilteringEngine; let acceptedCount = snfe.acceptedCount + sxfe.acceptedCount; @@ -915,6 +917,8 @@ onBroadcast(msg => { µb.selfieManager.destroy(); staticFilteringReverseLookup.resetLists(); + ubolog(`loadFilterLists() All filters removed at ${Date.now() - t0} ms`); + // We need to build a complete list of assets to pull first: this is // because it *may* happens that some load operations are synchronous: // This happens for assets which do not exist, or assets with no @@ -950,6 +954,7 @@ onBroadcast(msg => { µb.loadFilterLists = function() { if ( loadingPromise instanceof Promise ) { return loadingPromise; } + ubolog('loadFilterLists() Start'); t0 = Date.now(); loadedListKeys.length = 0; loadingPromise = Promise.all([