@@ -3451,7 +3451,9 @@ FilterContainer.prototype.benchmark = async function(action, target) {
3451
3451
return ;
3452
3452
}
3453
3453
3454
- console . info ( `Benchmarking staticNetFilteringEngine.matchString()...` ) ;
3454
+ const print = log . print ;
3455
+
3456
+ print ( `Benchmarking staticNetFilteringEngine.matchString()...` ) ;
3455
3457
const fctxt = µb . filteringContext . duplicate ( ) ;
3456
3458
3457
3459
if ( typeof target === 'number' ) {
@@ -3460,10 +3462,10 @@ FilterContainer.prototype.benchmark = async function(action, target) {
3460
3462
fctxt . setDocOriginFromURL ( request . frameUrl ) ;
3461
3463
fctxt . setType ( request . cpt ) ;
3462
3464
const r = this . matchString ( fctxt ) ;
3463
- console . log ( `Result=${ r } :` ) ;
3464
- console . log ( `\ttype=${ fctxt . type } ` ) ;
3465
- console . log ( `\turl=${ fctxt . url } ` ) ;
3466
- console . log ( `\tdocOrigin=${ fctxt . getDocOrigin ( ) } ` ) ;
3465
+ print ( `Result=${ r } :` ) ;
3466
+ print ( `\ttype=${ fctxt . type } ` ) ;
3467
+ print ( `\turl=${ fctxt . url } ` ) ;
3468
+ print ( `\tdocOrigin=${ fctxt . getDocOrigin ( ) } ` ) ;
3467
3469
if ( r !== 0 ) {
3468
3470
console . log ( this . toLogData ( ) ) ;
3469
3471
}
@@ -3492,21 +3494,21 @@ FilterContainer.prototype.benchmark = async function(action, target) {
3492
3494
const r = this . matchString ( fctxt ) ;
3493
3495
if ( recorded !== undefined ) { recorded . push ( r ) ; }
3494
3496
if ( expected !== undefined && r !== expected [ i ] ) {
3495
- console . log ( `Mismatch with reference results at ${ i } :` ) ;
3496
- console . log ( `\tExpected ${ expected [ i ] } , got ${ r } :` ) ;
3497
- console . log ( `\ttype=${ fctxt . type } ` ) ;
3498
- console . log ( `\turl=${ fctxt . url } ` ) ;
3499
- console . log ( `\tdocOrigin=${ fctxt . getDocOrigin ( ) } ` ) ;
3497
+ print ( `Mismatch with reference results at ${ i } :` ) ;
3498
+ print ( `\tExpected ${ expected [ i ] } , got ${ r } :` ) ;
3499
+ print ( `\ttype=${ fctxt . type } ` ) ;
3500
+ print ( `\turl=${ fctxt . url } ` ) ;
3501
+ print ( `\tdocOrigin=${ fctxt . getDocOrigin ( ) } ` ) ;
3500
3502
}
3501
3503
}
3502
3504
const t1 = self . performance . now ( ) ;
3503
3505
const dur = t1 - t0 ;
3504
3506
3505
- console . info ( `Evaluated ${ requests . length } requests in ${ dur . toFixed ( 0 ) } ms` ) ;
3506
- console . info ( `\tAverage: ${ ( dur / requests . length ) . toFixed ( 3 ) } ms per request` ) ;
3507
+ print ( `Evaluated ${ requests . length } requests in ${ dur . toFixed ( 0 ) } ms` ) ;
3508
+ print ( `\tAverage: ${ ( dur / requests . length ) . toFixed ( 3 ) } ms per request` ) ;
3507
3509
if ( expected !== undefined ) {
3508
- console . info ( `\tBlocked: ${ expected . reduce ( ( n , r ) => { return r === 1 ?n + 1 :n ; } , 0 ) } ` ) ;
3509
- console . info ( `\tExcepted: ${ expected . reduce ( ( n , r ) => { return r === 2 ?n + 1 :n ; } , 0 ) } ` ) ;
3510
+ print ( `\tBlocked: ${ expected . reduce ( ( n , r ) => { return r === 1 ?n + 1 :n ; } , 0 ) } ` ) ;
3511
+ print ( `\tExcepted: ${ expected . reduce ( ( n , r ) => { return r === 2 ?n + 1 :n ; } , 0 ) } ` ) ;
3510
3512
}
3511
3513
if ( recorded !== undefined ) {
3512
3514
vAPI . localStorage . setItem (
0 commit comments