Skip to content

Commit

Permalink
Add simple performance benchmark based on @ai's suggestion
Browse files Browse the repository at this point in the history
Usage:

```
time env BROWSERSLIST_DISABLE_CACHE=1 node test/perf-benchmark.js
time env BROWSERSLIST_DISABLE_CACHE= node test/perf-benchmark.js
```
  • Loading branch information
akx committed Feb 13, 2017
1 parent 1450e26 commit b9117a3
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/perf-benchmark.js
@@ -0,0 +1,11 @@
var browserslist = require('..');

[
{ file: './perf/one/app/css/hello.css', n: 3000 },
{ file: './perf/two/app/js/hello.js', n: 3000 },
{ file: './perf/three/app/js/hello.js', n: 3000 }
].forEach(function (test) {
for (var i = 0; i < test.n; i++) {
browserslist.findConfig(test.file);
}
});
Empty file added test/perf/one/app/css/hello.css
Empty file.
7 changes: 7 additions & 0 deletions test/perf/one/package.json
@@ -0,0 +1,7 @@
{
"private": true,
"browserslist": [
"ie 9",
"ie 10"
]
}
1 change: 1 addition & 0 deletions test/perf/three/app/js/hello.js
@@ -0,0 +1 @@
// three
Empty file added test/perf/two/app/js/hello.js
Empty file.
1 change: 1 addition & 0 deletions test/perf/two/browserslist
@@ -0,0 +1 @@
ie 11

0 comments on commit b9117a3

Please sign in to comment.