mirror of
https://github.com/nodejs/node.git
synced 2024-11-30 23:43:09 +01:00
0d15161c24
Path functions being benchmarked are: * format * isAbsolute * join * normalize * relative * resolve PR-URL: https://github.com/nodejs/io.js/pull/1778 Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
19 lines
352 B
JavaScript
19 lines
352 B
JavaScript
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.join('/foo', 'bar', '', 'baz/asdf', 'quux', '..');
|
|
}
|
|
bench.end(n);
|
|
}
|