/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
benchmark/perf_hooks/histogram-clone.js
24 строки
457 B
Vinícius Lourenço
perf_hooks: reduce overhead of createHistogram
23 окт 2023, 15:38
23 окт 2023, 15:38
adaef03
Код
Авторство
О чём код?
'use strict'; const assert = require('assert'); const common = require('../common.js'); const { createHistogram } = require('perf_hooks'); const bench = common.createBenchmark(main, { n: [1e5], }); let _histogram; function main({ n }) { const histogram = createHistogram(); bench.start(); for (let i = 0; i < n; i++) _histogram = structuredClone(histogram); bench.end(n); // Avoid V8 deadcode (elimination) assert.ok(_histogram); }