diff options
Diffstat (limited to 'deps/node/benchmark/path')
21 files changed, 0 insertions, 569 deletions
diff --git a/deps/node/benchmark/path/basename-posix.js b/deps/node/benchmark/path/basename-posix.js deleted file mode 100644 index 45cad1e2..00000000 --- a/deps/node/benchmark/path/basename-posix.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; -const common = require('../common.js'); -const { posix } = require('path'); - -const bench = common.createBenchmark(main, { - pathext: [ - '', - '/', - '/foo', - '/foo/.bar.baz', - ['/foo/.bar.baz', '.baz'].join('|'), - 'foo', - 'foo/bar.', - ['foo/bar.', '.'].join('|'), - '/foo/bar/baz/asdf/quux.html', - ['/foo/bar/baz/asdf/quux.html', '.html'].join('|'), - ], - n: [1e5] -}); - -function main({ n, pathext }) { - var ext; - const extIdx = pathext.indexOf('|'); - if (extIdx !== -1) { - ext = pathext.slice(extIdx + 1); - pathext = pathext.slice(0, extIdx); - } - - bench.start(); - for (var i = 0; i < n; i++) { - posix.basename(i % 3 === 0 ? `${pathext}${i}` : pathext, ext); - } - bench.end(n); -} diff --git a/deps/node/benchmark/path/basename-win32.js b/deps/node/benchmark/path/basename-win32.js deleted file mode 100644 index 30d65f3a..00000000 --- a/deps/node/benchmark/path/basename-win32.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; -const common = require('../common.js'); -const { win32 } = require('path'); - -const bench = common.createBenchmark(main, { - pathext: [ - '', - 'C:\\', - 'C:\\foo', - 'D:\\foo\\.bar.baz', - ['E:\\foo\\.bar.baz', '.baz'].join('|'), - 'foo', - 'foo\\bar.', - ['foo\\bar.', '.'].join('|'), - '\\foo\\bar\\baz\\asdf\\quux.html', - ['\\foo\\bar\\baz\\asdf\\quux.html', '.html'].join('|'), - ], - n: [1e5] -}); - -function main({ n, pathext }) { - var ext; - const extIdx = pathext.indexOf('|'); - if (extIdx !== -1) { - ext = pathext.slice(extIdx + 1); - pathext = pathext.slice(0, extIdx); - } - - bench.start(); - for (var i = 0; i < n; i++) { - win32.basename(i % 3 === 0 ? `${pathext}${i}` : pathext, ext); - } - bench.end(n); -} diff --git a/deps/node/benchmark/path/dirname-posix.js b/deps/node/benchmark/path/dirname-posix.js deleted file mode 100644 index 93f2f32c..00000000 --- a/deps/node/benchmark/path/dirname-posix.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict'; -const common = require('../common.js'); -const { posix } = require('path'); - -const bench = common.createBenchmark(main, { - path: [ - '', - '/', - '/foo', - '/foo/bar', - 'foo', - 'foo/bar', - '/foo/bar/baz/asdf/quux', - ], - n: [1e5] -}); - -function main({ n, path }) { - bench.start(); - for (var i = 0; i < n; i++) { - posix.dirname(i % 3 === 0 ? `${path}${i}` : path); - } - bench.end(n); -} diff --git a/deps/node/benchmark/path/dirname-win32.js b/deps/node/benchmark/path/dirname-win32.js deleted file mode 100644 index 510595d7..00000000 --- a/deps/node/benchmark/path/dirname-win32.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict'; -const common = require('../common.js'); -const { win32 } = require('path'); - -const bench = common.createBenchmark(main, { - path: [ - '', - '\\', - '\\foo', - 'C:\\foo\\bar', - 'foo', - 'foo\\bar', - 'D:\\foo\\bar\\baz\\asdf\\quux', - ], - n: [1e5] -}); - -function main({ n, path }) { - bench.start(); - for (var i = 0; i < n; i++) { - win32.dirname(i % 3 === 0 ? `${path}${i}` : path); - } - bench.end(n); -} diff --git a/deps/node/benchmark/path/extname-posix.js b/deps/node/benchmark/path/extname-posix.js deleted file mode 100644 index ee1ea07e..00000000 --- a/deps/node/benchmark/path/extname-posix.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; -const common = require('../common.js'); -const { posix } = require('path'); - -const bench = common.createBenchmark(main, { - path: [ - '', - '/', - '/foo', - 'foo/.bar.baz', - 'index.html', - 'index', - 'foo/bar/..baz.quux', - 'foo/bar/...baz.quux', - '/foo/bar/baz/asdf/quux', - '/foo/bar/baz/asdf/quux.foobarbazasdfquux', - ], - n: [1e5] -}); - -function main({ n, path }) { - bench.start(); - for (var i = 0; i < n; i++) { - posix.extname(i % 3 === 0 ? `${path}${i}` : path); - } - bench.end(n); -} diff --git a/deps/node/benchmark/path/extname-win32.js b/deps/node/benchmark/path/extname-win32.js deleted file mode 100644 index 1de4bca2..00000000 --- a/deps/node/benchmark/path/extname-win32.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; -const common = require('../common.js'); -const { win32 } = require('path'); - -const bench = common.createBenchmark(main, { - path: [ - '', - '\\', - 'C:\\foo', - 'foo\\.bar.baz', - 'index.html', - 'index', - 'foo\\bar\\..baz.quux', - 'foo\\bar\\...baz.quux', - 'D:\\foo\\bar\\baz\\asdf\\quux', - '\\foo\\bar\\baz\\asdf\\quux.foobarbazasdfquux', - ], - n: [1e5] -}); - -function main({ n, path }) { - bench.start(); - for (var i = 0; i < n; i++) { - win32.extname(i % 3 === 0 ? `${path}${i}` : path); - } - bench.end(n); -} diff --git a/deps/node/benchmark/path/format-posix.js b/deps/node/benchmark/path/format-posix.js deleted file mode 100644 index 9c555f23..00000000 --- a/deps/node/benchmark/path/format-posix.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; -const common = require('../common.js'); -const { posix } = require('path'); - -const bench = common.createBenchmark(main, { - props: [ - ['/', '/home/user/dir', 'index.html', '.html', 'index'].join('|'), - ], - n: [1e6] -}); - -function main({ n, props }) { - props = props.split('|'); - const obj = { - root: props[0] || '', - dir: props[1] || '', - base: '', - ext: props[3] || '', - name: '', - }; - - bench.start(); - for (var i = 0; i < n; i++) { - obj.base = `a${i}${props[2] || ''}`; - obj.name = `a${i}${props[4] || ''}`; - posix.format(obj); - } - bench.end(n); -} diff --git a/deps/node/benchmark/path/format-win32.js b/deps/node/benchmark/path/format-win32.js deleted file mode 100644 index 65315c4d..00000000 --- a/deps/node/benchmark/path/format-win32.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; -const common = require('../common.js'); -const { win32 } = require('path'); - -const bench = common.createBenchmark(main, { - props: [ - ['C:\\', 'C:\\path\\dir', 'index.html', '.html', 'index'].join('|'), - ], - n: [1e6] -}); - -function main({ n, props }) { - props = props.split('|'); - const obj = { - root: props[0] || '', - dir: props[1] || '', - base: '', - ext: props[3] || '', - name: '', - }; - - bench.start(); - for (var i = 0; i < n; i++) { - obj.base = `a${i}${props[2] || ''}`; - obj.name = `a${i}${props[4] || ''}`; - win32.format(obj); - } - bench.end(n); -} diff --git a/deps/node/benchmark/path/isAbsolute-posix.js b/deps/node/benchmark/path/isAbsolute-posix.js deleted file mode 100644 index dd0dfd19..00000000 --- a/deps/node/benchmark/path/isAbsolute-posix.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; -const common = require('../common.js'); -const { posix } = require('path'); - -const bench = common.createBenchmark(main, { - path: [ - '', - '.', - '/foo/bar', - '/baz/..', - 'bar/baz', - ], - n: [1e5] -}); - -function main({ n, path }) { - bench.start(); - for (var i = 0; i < n; i++) { - posix.isAbsolute(i % 3 === 0 ? `${path}${i}` : path); - } - bench.end(n); -} diff --git a/deps/node/benchmark/path/isAbsolute-win32.js b/deps/node/benchmark/path/isAbsolute-win32.js deleted file mode 100644 index ff03f262..00000000 --- a/deps/node/benchmark/path/isAbsolute-win32.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; -const common = require('../common.js'); -const { win32 } = require('path'); - -const bench = common.createBenchmark(main, { - path: [ - '', - '.', - '//server', - 'C:\\baz\\..', - 'C:baz\\..', - 'bar\\baz', - ], - n: [1e5] -}); - -function main({ n, path }) { - bench.start(); - for (var i = 0; i < n; i++) { - win32.isAbsolute(i % 3 === 0 ? `${path}${i}` : path); - } - bench.end(n); -} diff --git a/deps/node/benchmark/path/join-posix.js b/deps/node/benchmark/path/join-posix.js deleted file mode 100644 index e573166d..00000000 --- a/deps/node/benchmark/path/join-posix.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; -const common = require('../common.js'); -const { posix } = require('path'); - -const bench = common.createBenchmark(main, { - paths: [ - ['/foo', 'bar', '', 'baz/asdf', 'quux', '..'].join('|'), - ], - n: [1e5] -}); - -function main({ n, paths }) { - const args = paths.split('|'); - const copy = [...args]; - const orig = copy[1]; - - bench.start(); - for (var i = 0; i < n; i++) { - if (i % 3 === 0) { - copy[1] = `${orig}${i}`; - posix.join(...copy); - } else { - posix.join(...args); - } - } - bench.end(n); -} diff --git a/deps/node/benchmark/path/join-win32.js b/deps/node/benchmark/path/join-win32.js deleted file mode 100644 index cd69836c..00000000 --- a/deps/node/benchmark/path/join-win32.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; -const common = require('../common.js'); -const { win32 } = require('path'); - -const bench = common.createBenchmark(main, { - paths: [ - ['C:\\foo', 'bar', '', 'baz\\asdf', 'quux', '..'].join('|'), - ], - n: [1e5] -}); - -function main({ n, paths }) { - const args = paths.split('|'); - const copy = [...args]; - const orig = copy[1]; - - bench.start(); - for (var i = 0; i < n; i++) { - if (i % 3 === 0) { - copy[1] = `${orig}${i}`; - win32.join(...copy); - } else { - win32.join(...args); - } - } - bench.end(n); -} diff --git a/deps/node/benchmark/path/makeLong-win32.js b/deps/node/benchmark/path/makeLong-win32.js deleted file mode 100644 index 45d0d8de..00000000 --- a/deps/node/benchmark/path/makeLong-win32.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; -const common = require('../common.js'); -const { win32 } = require('path'); - -const bench = common.createBenchmark(main, { - path: [ - 'foo\\bar', - 'C:\\foo', - '\\\\foo\\bar', - '\\\\?\\foo', - ], - n: [1e5] -}); - -function main({ n, path }) { - bench.start(); - for (var i = 0; i < n; i++) { - win32._makeLong(i % 3 === 0 ? `${path}${i}` : path); - } - bench.end(n); -} diff --git a/deps/node/benchmark/path/normalize-posix.js b/deps/node/benchmark/path/normalize-posix.js deleted file mode 100644 index 4383cff4..00000000 --- a/deps/node/benchmark/path/normalize-posix.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; -const common = require('../common.js'); -const { posix } = require('path'); - -const bench = common.createBenchmark(main, { - path: [ - '', - '.', - '/../', - '/foo', - '/foo/bar', - '/foo/bar//baz/asdf/quux/..', - ], - n: [1e5] -}); - -function main({ n, path }) { - bench.start(); - for (var i = 0; i < n; i++) { - posix.normalize(i % 3 === 0 ? `${path}${i}` : path); - } - bench.end(n); -} diff --git a/deps/node/benchmark/path/normalize-win32.js b/deps/node/benchmark/path/normalize-win32.js deleted file mode 100644 index 319c391d..00000000 --- a/deps/node/benchmark/path/normalize-win32.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; -const common = require('../common.js'); -const { win32 } = require('path'); - -const bench = common.createBenchmark(main, { - path: [ - '', - '.', - 'C:\\..\\', - 'C:\\foo', - 'C:\\foo\\bar', - 'C:\\foo\\bar\\\\baz\\asdf\\quux\\..', - ], - n: [1e5] -}); - -function main({ n, path }) { - bench.start(); - for (var i = 0; i < n; i++) { - win32.normalize(i % 3 === 0 ? `${path}${i}` : path); - } - bench.end(n); -} diff --git a/deps/node/benchmark/path/parse-posix.js b/deps/node/benchmark/path/parse-posix.js deleted file mode 100644 index 7fb1d550..00000000 --- a/deps/node/benchmark/path/parse-posix.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict'; -const common = require('../common.js'); -const { posix } = require('path'); - -const bench = common.createBenchmark(main, { - path: [ - '', - '/', - '/foo', - '/foo/bar.baz', - 'foo/.bar.baz', - 'foo/bar', - '/foo/bar/baz/asdf/.quux', - ], - n: [1e5] -}); - -function main({ n, path }) { - bench.start(); - for (let i = 0; i < n; i++) { - posix.parse(i % 3 === 0 ? `${path}${i}` : path); - } - bench.end(n); -} diff --git a/deps/node/benchmark/path/parse-win32.js b/deps/node/benchmark/path/parse-win32.js deleted file mode 100644 index ea4bc34a..00000000 --- a/deps/node/benchmark/path/parse-win32.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; -const common = require('../common.js'); -const { win32 } = require('path'); - -const bench = common.createBenchmark(main, { - path: [ - '', - 'C:\\', - 'C:\\foo', - '\\foo', - 'E:\\foo\\bar.baz', - 'foo\\.bar.baz', - 'foo\\bar', - '\\foo\\bar\\baz\\asdf\\.quux', - ], - n: [1e5] -}); - -function main({ n, path }) { - bench.start(); - for (let i = 0; i < n; i++) { - win32.parse(i % 3 === 0 ? `${path}${i}` : path); - } - bench.end(n); -} 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); -} diff --git a/deps/node/benchmark/path/relative-win32.js b/deps/node/benchmark/path/relative-win32.js deleted file mode 100644 index 5f34fdf8..00000000 --- a/deps/node/benchmark/path/relative-win32.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; -const common = require('../common.js'); -const { win32 } = require('path'); - -const bench = common.createBenchmark(main, { - paths: [ - ['C:\\orandea\\test\\aaa', 'C:\\orandea\\impl\\bbb'].join('|'), - ['C:\\', 'D:\\'].join('|'), - ['C:\\foo\\bar\\baz', 'C:\\foo\\bar\\baz'].join('|'), - ['C:\\foo\\BAR\\BAZ', 'C:\\foo\\bar\\baz'].join('|'), - ['C:\\foo\\bar\\baz\\quux', 'C:\\'].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) - win32.relative(`${paths}${i}`, `${to}${i}`); - else - win32.relative(paths, to); - } - bench.end(n); -} diff --git a/deps/node/benchmark/path/resolve-posix.js b/deps/node/benchmark/path/resolve-posix.js deleted file mode 100644 index 3cdf1cd4..00000000 --- a/deps/node/benchmark/path/resolve-posix.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict'; -const common = require('../common.js'); -const { posix } = require('path'); - -const bench = common.createBenchmark(main, { - paths: [ - '', - ['', ''].join('|'), - ['foo/bar', '/tmp/file/', '..', 'a/../subfile'].join('|'), - ['a/b/c/', '../../..'].join('|'), - ], - n: [1e5] -}); - -function main({ n, paths }) { - const args = paths.split('|'); - const copy = [...args]; - const orig = copy[0]; - - bench.start(); - for (var i = 0; i < n; i++) { - if (i % 3 === 0) { - copy[0] = `${orig}${i}`; - posix.resolve(...copy); - } else { - posix.resolve(...args); - } - } - bench.end(n); -} diff --git a/deps/node/benchmark/path/resolve-win32.js b/deps/node/benchmark/path/resolve-win32.js deleted file mode 100644 index cf8144ef..00000000 --- a/deps/node/benchmark/path/resolve-win32.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict'; -const common = require('../common.js'); -const { win32 } = require('path'); - -const bench = common.createBenchmark(main, { - paths: [ - '', - ['', ''].join('|'), - ['c:/ignore', 'd:\\a/b\\c/d', '\\e.exe'].join('|'), - ['c:/blah\\blah', 'd:/games', 'c:../a'].join('|'), - ], - n: [1e5] -}); - -function main({ n, paths }) { - const args = paths.split('|'); - const copy = [...args]; - const orig = copy[0]; - - bench.start(); - for (var i = 0; i < n; i++) { - if (i % 3 === 0) { - copy[0] = `${orig}${i}`; - win32.resolve(...copy); - } else { - win32.resolve(...args); - } - } - bench.end(n); -} |