Skip to content

Commit

Permalink
benchmark: use unique filenames in fs benchmarks
Browse files Browse the repository at this point in the history
Use a unique file name for each benchmark. Running benchmarks
simultaneously may be a bit of an unusual use case, but there are use
cases, such as stress testing `test/parallel/test-benchmark-fs.js`.

PR-URL: #16776
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
Trott authored and MylesBorins committed Dec 11, 2017
1 parent b931169 commit 9ffdee8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion benchmark/fs/read-stream-throughput.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

const path = require('path');
const common = require('../common.js');
const filename = path.resolve(__dirname, '.removeme-benchmark-garbage');
const filename = path.resolve(__dirname,
`.removeme-benchmark-garbage-${process.pid}`);
const fs = require('fs');
const assert = require('assert');

Expand Down
3 changes: 2 additions & 1 deletion benchmark/fs/readfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

const path = require('path');
const common = require('../common.js');
const filename = path.resolve(__dirname, '.removeme-benchmark-garbage');
const filename = path.resolve(__dirname,
`.removeme-benchmark-garbage-${process.pid}`);
const fs = require('fs');

const bench = common.createBenchmark(main, {
Expand Down
3 changes: 2 additions & 1 deletion benchmark/fs/write-stream-throughput.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

const path = require('path');
const common = require('../common.js');
const filename = path.resolve(__dirname, '.removeme-benchmark-garbage');
const filename = path.resolve(__dirname,
`.removeme-benchmark-garbage-${process.pid}`);
const fs = require('fs');

const bench = common.createBenchmark(main, {
Expand Down

0 comments on commit 9ffdee8

Please sign in to comment.