From 92953fa1941937a33abc1830fdbd76d8ec091083 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Sat, 30 Dec 2017 03:57:01 +0100 Subject: benchmark: (path) use destructuring PR-URL: https://github.com/nodejs/node/pull/18250 Reviewed-By: Matteo Collina Reviewed-By: James M Snell --- benchmark/path/parse-posix.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'benchmark/path/parse-posix.js') 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); } -- cgit v1.2.3