Perf: repalce aho-corasick w/ regexp

This commit is contained in:
SukkaW
2025-01-03 22:30:39 +08:00
parent 090f055677
commit ef1b80fb90
7 changed files with 14 additions and 14 deletions

View File

@@ -7,7 +7,7 @@ import { readFileByLine } from './lib/fetch-text-by-line';
import path from 'node:path';
import { OUTPUT_SURGE_DIR } from './constants/dir';
import { $fetch } from './lib/make-fetch-happen';
import { createAhoCorasick as createKeywordFilter } from 'foxts/ahocorasick';
import { createRetrieKeywordFilter as createKeywordFilter } from 'foxts/retrie';
export async function parseGfwList() {
const whiteSet = new Set<string>();
@@ -117,7 +117,7 @@ export async function parseGfwList() {
whiteSet.forEach(domain => trie.whitelist(domain));
const kwfilter = createKeywordFilter(keywordSet);
const kwfilter = createKeywordFilter([...keywordSet]);
const missingTop10000Gfwed = new Set<string>();