Perf: fastest dedupe

This commit is contained in:
SukkaW
2023-07-07 15:07:45 +08:00
parent 9dd9e4aa05
commit b659bff079
2 changed files with 22 additions and 30 deletions

View File

@@ -183,15 +183,17 @@ const domainSuffixSet = new Set();
const START_TIME = Date.now();
const domainSetsArray = Array.from(domainSets);
const workerData = preprocessFullDomainSetBeforeUsedAsWorkerData(domainSetsArray);
const piscina = new Piscina({
filename: pathResolve(__dirname, 'worker/build-reject-domainset-worker.js'),
workerData: preprocessFullDomainSetBeforeUsedAsWorkerData(Array.from(domainSetsArray)),
workerData,
idleTimeout: 50,
minThreads: threads,
maxThreads: threads
});
console.log(preprocessFullDomainSetBeforeUsedAsWorkerData(Array.from(domainSetsArray)).length);
console.log(workerData.length);
console.log(`Launching ${threads} threads...`);