Skip to content

Commit

Permalink
build: add tiny-glob to product synchronous benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmlnc committed Jun 27, 2021
1 parent 6257af0 commit 0ed6291
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/benchmark/suites/product/sync/tiny-glob.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import * as path from 'path';

import * as utils from '../../../utils';

// eslint-disable-next-line @typescript-eslint/no-require-imports
import glob = require('tiny-glob/sync');

const options = {
cwd: path.join(process.cwd(), process.env.BENCHMARK_BASE_DIR as string),
flush: true
};

const timeStart = utils.timeStart();

try {
const matches = glob(process.env.BENCHMARK_PATTERN as string, options);
const memory = utils.getMemory();
const time = utils.timeEnd(timeStart);
const measures = utils.formatMeasures(matches.length, time, memory);

console.info(measures);
} catch {
process.exit(0);
}

0 comments on commit 0ed6291

Please sign in to comment.