diff options
Diffstat (limited to 'benchmark/path/resolve.js')
-rw-r--r-- | benchmark/path/resolve.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/benchmark/path/resolve.js b/benchmark/path/resolve.js new file mode 100644 index 0000000000..ecf30f32fa --- /dev/null +++ b/benchmark/path/resolve.js @@ -0,0 +1,18 @@ +var common = require('../common.js'); +var path = require('path'); + +var bench = common.createBenchmark(main, { + type: ['win32', 'posix'], + n: [1e6], +}); + +function main(conf) { + var n = +conf.n; + var p = path[conf.type]; + + bench.start(); + for (var i = 0; i < n; i++) { + p.resolve('foo/bar', '/tmp/file/', '..', 'a/../subfile'); + } + bench.end(n); +} |