Skip to content

Commit

Permalink
add benchmarks for scan
Browse files Browse the repository at this point in the history
  • Loading branch information
jonschlinkert committed Oct 31, 2019
1 parent 777f038 commit 4793b92
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions bench/glob-parent.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ function bench(name, options) {
return suite;
}

bench(red('*.js'))
.add(' picomatch', () => scan('*.js'))
.add('glob-parent', () => parent('*.js'))
.run();

bench(red('foo/bar/baz'))
.add(' picomatch', () => scan('foo/bar/baz'))
.add('glob-parent', () => parent('foo/bar/baz'))
.run();

bench(red('foo/*.js'))
.add(' picomatch', () => scan('foo/*.js'))
.add('glob-parent', () => parent('foo/*.js'))
Expand All @@ -51,3 +61,23 @@ bench(red('foo/{a,b}/*.js'))
.add(' picomatch', () => scan('foo/{a,b}/*.js'))
.add('glob-parent', () => parent('foo/{a,b}/*.js'))
.run();

bench(red('*.js { segments: true }'))
.add(' picomatch', () => scan('*.js', { segments: true }))
.add('glob-parent', () => parent('*.js'))
.run();

bench(red('foo/bar/baz { segments: true }'))
.add(' picomatch', () => scan('foo/bar/baz', { segments: true }))
.add('glob-parent', () => parent('foo/bar/baz'))
.run();

bench(red('foo/*.js { segments: true }'))
.add(' picomatch', () => scan('foo/*.js', { segments: true }))
.add('glob-parent', () => parent('foo/*.js'))
.run();

bench(red('foo/{a,b}/*.js { segments: true }'))
.add(' picomatch', () => scan('foo/{a,b}/*.js', { segments: true }))
.add('glob-parent', () => parent('foo/{a,b}/*.js'))
.run();

0 comments on commit 4793b92

Please sign in to comment.