/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
benchmark/util/inspect-proxy.js
23 строки
510 B
Antoine du Hamel
benchmark: add trailing commas in `benchmark/util`
03 фев 2023, 13:42
Не верифицирован
03 фев 2023, 13:42
83cc1e2
Код
Авторство
О чём код?
'use strict'; const util = require('util'); const common = require('../common.js'); const bench = common.createBenchmark(main, { n: [1e5], showProxy: [0, 1], isProxy: [0, 1], }); function main({ n, showProxy, isProxy }) { let proxyA = {}; let proxyB = () => {}; if (isProxy) { proxyA = new Proxy(proxyA, { get: () => {} }); proxyB = new Proxy(proxyB, {}); } bench.start(); for (let i = 0; i < n; i += 1) util.inspect({ a: proxyA, b: proxyB }, { showProxy }); bench.end(n); }