This repository has been archived by the owner on Oct 15, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 341
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
meta: merge node/master into node-chakracore/master
Merge ac829f0 as of 2018-02-06 This commit was automatically generated. For any problems, please contact jackhorton Reviewed-By: Jimmy Thomson <jithomso@microsoft.com>
- Loading branch information
Showing
61 changed files
with
3,407 additions
and
393 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
'use strict'; | ||
|
||
const common = require('../common'); | ||
const fs = require('fs'); | ||
|
||
const bench = common.createBenchmark(main, { | ||
n: [20e4], | ||
statType: ['fstat', 'lstat', 'stat'] | ||
}); | ||
|
||
async function run(n, statType) { | ||
const arg = statType === 'fstat' ? | ||
await fs.promises.open(__filename, 'r') : __filename; | ||
let remaining = n; | ||
bench.start(); | ||
while (remaining-- > 0) | ||
await fs.promises[statType](arg); | ||
bench.end(n); | ||
|
||
if (typeof arg.close === 'function') | ||
await arg.close(); | ||
} | ||
|
||
function main(conf) { | ||
const n = conf.n >>> 0; | ||
const statType = conf.statType; | ||
run(n, statType).catch(console.log); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.