2016-02-20 02:03:16 +01:00
|
|
|
'use strict';
|
2017-09-14 03:48:53 +02:00
|
|
|
const common = require('../common.js');
|
2017-12-30 03:57:01 +01:00
|
|
|
const { win32 } = require('path');
|
2015-07-04 21:50:07 +02:00
|
|
|
|
2017-09-14 03:48:53 +02:00
|
|
|
const bench = common.createBenchmark(main, {
|
2016-02-06 04:23:29 +01:00
|
|
|
path: [
|
|
|
|
'',
|
|
|
|
'C:\\',
|
|
|
|
'C:\\foo',
|
|
|
|
'\\foo',
|
|
|
|
'E:\\foo\\bar.baz',
|
|
|
|
'foo\\.bar.baz',
|
|
|
|
'foo\\bar',
|
|
|
|
'\\foo\\bar\\baz\\asdf\\.quux'
|
|
|
|
],
|
|
|
|
n: [1e6]
|
2015-07-04 21:50:07 +02:00
|
|
|
});
|
|
|
|
|
2017-12-30 03:57:01 +01:00
|
|
|
function main({ n, path }) {
|
2015-07-04 21:50:07 +02:00
|
|
|
for (var i = 0; i < n; i++) {
|
2017-12-30 03:57:01 +01:00
|
|
|
win32.parse(path);
|
2015-07-04 21:50:07 +02:00
|
|
|
}
|
2017-03-01 12:37:12 +01:00
|
|
|
bench.start();
|
|
|
|
for (i = 0; i < n; i++) {
|
2017-12-30 03:57:01 +01:00
|
|
|
win32.parse(path);
|
2017-03-01 12:37:12 +01:00
|
|
|
}
|
2015-07-04 21:50:07 +02:00
|
|
|
bench.end(n);
|
|
|
|
}
|