/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v26.2.0
benchmark/url/url-parse.js
22 строки
417 B
Antoine du Hamel
benchmark: add trailing commas in `benchmark/url`
10 фев 2023, 03:54
Не верифицирован
10 фев 2023, 03:54
3aef395
Код
Авторство
О чём код?
'use strict'; const common = require('../common.js'); const url = require('url'); const inputs = { normal: 'http://foo.com/bar', escaped: 'https://foo.bar/{}^`/abcd', }; const bench = common.createBenchmark(main, { type: Object.keys(inputs), n: [1e7], }); function main({ type, n }) { const input = inputs[type]; bench.start(); for (let i = 0; i < n; i += 1) url.parse(input); bench.end(n); }