Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'benchmark/path/resolve.js')
-rw-r--r--benchmark/path/resolve.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/benchmark/path/resolve.js b/benchmark/path/resolve.js
new file mode 100644
index 00000000000..ecf30f32fab
--- /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);
+}