Add trace information to console

This commit is contained in:
Raymond Hill 2024-01-27 07:22:32 -05:00
parent 8be8ac57a7
commit f200bbf5d5
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 9 additions and 4 deletions

View File

@ -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([