Skip to content

Commit

Permalink
Merge pull request #323 from mrmlnc/TRIVIAL_update_tiny-glob_benchmark
Browse files Browse the repository at this point in the history
TRIVIAL: add `tiny-glob` to product synchronous benchmark
  • Loading branch information
mrmlnc committed Jun 27, 2021
2 parents 6257af0 + 0ed6291 commit 190e6bf
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 190e6bf

Please sign in to comment.