/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v22.22.2
benchmark/path/parse-posix.js
24 строки
435 B
Antoine du Hamel
benchmark: add trailing commas in `benchmark/path`
14 фев 2023, 20:09
Не верифицирован
14 фев 2023, 20:09
3acdeb1
Код
Авторство
О чём код?
'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); }