diff options
Diffstat (limited to 'deps/node/benchmark/path/relative-posix.js')
-rw-r--r-- | deps/node/benchmark/path/relative-posix.js | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/deps/node/benchmark/path/relative-posix.js b/deps/node/benchmark/path/relative-posix.js deleted file mode 100644 index 2c4dd31d..00000000 --- a/deps/node/benchmark/path/relative-posix.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; -const common = require('../common.js'); -const { posix } = require('path'); - -const bench = common.createBenchmark(main, { - paths: [ - ['/data/orandea/test/aaa', '/data/orandea/impl/bbb'].join('|'), - ['/', '/var'].join('|'), - ['/', '/'].join('|'), - ['/var', '/bin'].join('|'), - ['/foo/bar/baz/quux', '/'].join('|'), - ['/foo/bar/baz/quux', '/foo/bar/baz/quux'].join('|'), - ['/foo/bar/baz/quux', '/var/log'].join('|'), - ], - n: [1e5] -}); - -function main({ n, paths }) { - var to = ''; - const delimIdx = paths.indexOf('|'); - if (delimIdx > -1) { - to = paths.slice(delimIdx + 1); - paths = paths.slice(0, delimIdx); - } - - bench.start(); - for (let i = 0; i < n; i++) { - if (i % 3 === 0) - posix.relative(`${paths}${i}`, `${to}${i}`); - else - posix.relative(paths, to); - } - bench.end(n); -} |