File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -2698,16 +2698,18 @@ FilterContainer.prototype.benchmark = function() {
2698
2698
}
2699
2699
console . info ( `Benchmarking staticNetFilteringEngine.matchString()...` ) ;
2700
2700
const fctxt = µb . filteringContext . duplicate ( ) ;
2701
+ let blockCount = 0 ;
2701
2702
const t0 = self . performance . now ( ) ;
2702
2703
for ( const request of requests ) {
2703
2704
fctxt . setURL ( request . url ) ;
2704
2705
fctxt . setDocOriginFromURL ( request . frameUrl ) ;
2705
2706
fctxt . setType ( request . cpt ) ;
2706
- this . matchString ( fctxt ) ;
2707
+ if ( this . matchString ( fctxt ) === 1 ) { blockCount += 1 ; }
2707
2708
}
2708
2709
const t1 = self . performance . now ( ) ;
2709
2710
const dur = t1 - t0 ;
2710
2711
console . info ( `Evaluated ${ requests . length } requests in ${ dur . toFixed ( 0 ) } ms` ) ;
2712
+ console . info ( `\tBlocked: ${ blockCount } ` ) ;
2711
2713
console . info ( `\tAverage: ${ ( dur / requests . length ) . toFixed ( 3 ) } ms per request` ) ;
2712
2714
} ) ;
2713
2715
return 'ok' ;
You can’t perform that action at this time.
0 commit comments