Perf: use tldts-experimental when possible

This commit is contained in:
SukkaW
2024-05-26 04:32:08 +08:00
parent db6786a0d6
commit 1288460c48
9 changed files with 32 additions and 24 deletions

View File

@@ -11,7 +11,10 @@ import createKeywordFilter from './lib/aho-corasick';
import { readFileByLine, readFileIntoProcessedArray } from './lib/fetch-text-by-line';
import { sortDomains } from './lib/stable-sort-domain';
import { task } from './trace';
import * as tldts from 'tldts';
// tldts-experimental is way faster than tldts, but very little bit inaccurate
// (since it is hashes based). But the result is still deterministic, which is
// enough when creating a simple stat of reject hosts.
import * as tldts from 'tldts-experimental';
import { SHARED_DESCRIPTION } from './lib/constants';
import { getPhishingDomains } from './lib/get-phishing-domains';