Skip to content

Commit

Permalink
Meta tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Aug 23, 2019
1 parent 01da91f commit 12c443d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
22 changes: 19 additions & 3 deletions benchmark.js
Expand Up @@ -9,7 +9,7 @@ const suite = new Benchmark.Suite('concurrency');

const tempDir = tempy.directory();

const fixtures = Array.from({length: 2000}, (x, index) => {
const fixtures = Array.from({length: 2000}, (_, index) => {
return path.resolve(tempDir, (index + 1).toString());
});

Expand All @@ -19,7 +19,22 @@ function createFixtures() {
}
}

const concurrencies = [1, 3, 5, 10, 15, 20, 50, 100, 200, 300, 400, 500, 1000, Infinity];
const concurrencies = [
1,
3,
5,
10,
15,
20,
50,
100,
200,
300,
400,
500,
1000,
Infinity
];

for (const concurrency of concurrencies) {
const name = `concurrency: ${concurrency.toString()}`;
Expand All @@ -29,7 +44,8 @@ for (const concurrency of concurrencies) {
defer: true,
setup() {}, // This line breaks async await
async fn(deferred) {
// Can't use setup because it isn't called after every defer
// Can't use `setup()` because it isn't called after every
// defer and it breaks using `async` keyword here.
// https://github.com/bestiejs/benchmark.js/issues/136
createFixtures();

Expand Down
10 changes: 5 additions & 5 deletions package.json
Expand Up @@ -45,21 +45,21 @@
"filesystem"
],
"dependencies": {
"globby": "^10.0.0",
"globby": "^10.0.1",
"graceful-fs": "^4.2.2",
"is-glob": "^4.0.1",
"is-path-cwd": "^2.0.0",
"is-path-cwd": "^2.2.0",
"is-path-inside": "^3.0.1",
"slash": "^3.0.0",
"p-map": "^3.0.0",
"rimraf": "^3.0.0"
"rimraf": "^3.0.0",
"slash": "^3.0.0"
},
"devDependencies": {
"ava": "^2.3.0",
"benchmark": "^2.1.4",
"make-dir": "^3.0.0",
"tempy": "^0.3.0",
"tsd": "^0.7.3",
"tsd": "^0.7.4",
"xo": "^0.24.0"
}
}

0 comments on commit 12c443d

Please sign in to comment.