Fine tune code of optimizeOriginHitTests()

Related commit:
- b265f2644d
This commit is contained in:
Raymond Hill 2020-11-14 07:28:51 -05:00
parent 4afb3dc149
commit 5cf9bcf27c
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 5 additions and 2 deletions

View File

@ -2256,7 +2256,10 @@ const FilterBucket = class extends FilterCollection {
const f = filterUnits[iunit]; const f = filterUnits[iunit];
if ( f.hasOriginHit === true ) { if ( f.hasOriginHit === true ) {
domainOpts.push(f.domainOpt); domainOpts.push(f.domainOpt);
bucket.unshift(iunit); // move the sequence slot to new bucket
filterSequences[i+1] = bucket.i;
bucket.i = i;
bucket.n += 1;
if ( iprev !== 0 ) { if ( iprev !== 0 ) {
filterSequences[iprev+1] = inext; filterSequences[iprev+1] = inext;
} else { } else {
@ -3226,7 +3229,7 @@ FilterContainer.prototype.freeze = function() {
this.optimizeTimerId = self.requestIdleCallback(( ) => { this.optimizeTimerId = self.requestIdleCallback(( ) => {
this.optimizeTimerId = undefined; this.optimizeTimerId = undefined;
this.optimize(); this.optimize();
}, { timeout: 15000 }); }, { timeout: 10000 });
log.info(`staticNetFilteringEngine.freeze() took ${Date.now()-t0} ms`); log.info(`staticNetFilteringEngine.freeze() took ${Date.now()-t0} ms`);
}; };