-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #323 from mrmlnc/TRIVIAL_update_tiny-glob_benchmark
TRIVIAL: add `tiny-glob` to product synchronous benchmark
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |