mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
benchmark: make temp file path configurable
In three fs benchmarks, a temp file is created in the source tree. For tests, allow the location to be configurable so it gets written to the test temp directory instead. Additionally, shave about a second off the test running time by setting `dur` to `0.1` instead of `1`. PR-URL: https://github.com/nodejs/node/pull/17811 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
This commit is contained in:
parent
4444b6b9ad
commit
d610fad390
@ -3,7 +3,7 @@
|
||||
|
||||
const path = require('path');
|
||||
const common = require('../common.js');
|
||||
const filename = path.resolve(__dirname,
|
||||
const filename = path.resolve(process.env.NODE_TMPDIR || __dirname,
|
||||
`.removeme-benchmark-garbage-${process.pid}`);
|
||||
const fs = require('fs');
|
||||
const assert = require('assert');
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
const path = require('path');
|
||||
const common = require('../common.js');
|
||||
const filename = path.resolve(__dirname,
|
||||
const filename = path.resolve(process.env.NODE_TMPDIR || __dirname,
|
||||
`.removeme-benchmark-garbage-${process.pid}`);
|
||||
const fs = require('fs');
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
const path = require('path');
|
||||
const common = require('../common.js');
|
||||
const filename = path.resolve(__dirname,
|
||||
const filename = path.resolve(process.env.NODE_TMPDIR || __dirname,
|
||||
`.removeme-benchmark-garbage-${process.pid}`);
|
||||
const fs = require('fs');
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
'use strict';
|
||||
|
||||
require('../common');
|
||||
const common = require('../common');
|
||||
const runBenchmark = require('../common/benchmark');
|
||||
|
||||
runBenchmark('fs', [
|
||||
'n=1',
|
||||
'size=1',
|
||||
'dur=1',
|
||||
'dur=0.1',
|
||||
'len=1024',
|
||||
'concurrent=1',
|
||||
'pathType=relative',
|
||||
@ -14,4 +14,4 @@ runBenchmark('fs', [
|
||||
'statSyncType=fstatSync',
|
||||
'encodingType=buf',
|
||||
'filesize=1024'
|
||||
]);
|
||||
], { NODE_TMPDIR: common.tmpDir });
|
||||
|
Loading…
Reference in New Issue
Block a user