mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-12 17:20:35 +08:00
16 lines
568 B
TypeScript
16 lines
568 B
TypeScript
import { bench, group, run } from 'mitata';
|
|
import { processLine, processLineFromReadline } from './process-line';
|
|
import { readFileByLine } from './fetch-text-by-line';
|
|
import path from 'node:path';
|
|
import fsp from 'node:fs/promises';
|
|
import { SOURCE_DIR } from '../constants/dir';
|
|
|
|
const file = path.join(SOURCE_DIR, 'domainset/cdn.conf');
|
|
|
|
group(() => {
|
|
bench('readFileByLine', () => processLineFromReadline(readFileByLine(file)));
|
|
bench('fsp.readFile', () => fsp.readFile(file, 'utf-8').then((content) => content.split('\n').filter(processLine)));
|
|
});
|
|
|
|
run();
|