aboutsummaryrefslogtreecommitdiff
path: root/benchmark/path/parse-posix.js
diff options
context:
space:
mode:
Diffstat (limited to 'benchmark/path/parse-posix.js')
-rw-r--r--benchmark/path/parse-posix.js12
1 files changed, 4 insertions, 8 deletions
diff --git a/benchmark/path/parse-posix.js b/benchmark/path/parse-posix.js
index 4f1fb898b8..dd1153d3c6 100644
--- a/benchmark/path/parse-posix.js
+++ b/benchmark/path/parse-posix.js
@@ -1,6 +1,6 @@
'use strict';
const common = require('../common.js');
-const path = require('path');
+const { posix } = require('path');
const bench = common.createBenchmark(main, {
path: [
@@ -15,17 +15,13 @@ const bench = common.createBenchmark(main, {
n: [1e6]
});
-function main(conf) {
- const n = +conf.n;
- const p = path.posix;
- const input = String(conf.path);
-
+function main({ n, path }) {
for (var i = 0; i < n; i++) {
- p.parse(input);
+ posix.parse(path);
}
bench.start();
for (i = 0; i < n; i++) {
- p.parse(input);
+ posix.parse(path);
}
bench.end(n);
}