MCPcopy
hub / github.com/mongodb/node-mongodb-native / testArrayPush

Function testArrayPush

test/benchmarks/unitBench/list.bench.js:71–82  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

69};
70
71const testArrayPush = () => {
72 const bigArray = [];
73 const h = createHistogram();
74 for (let runs = 0; runs < iterations; runs++) {
75 h.recordDelta();
76 for (let i = 0; i < defaultItemsSize; i++) bigArray.push(1);
77 h.recordDelta();
78 bigArray.length = 0;
79 }
80
81 printHistogram(`push(${defaultItemsSize}) to Array`, h);
82};
83
84const testListPush = () => {
85 const bigList = new List();

Callers 1

mainFunction · 0.85

Calls 2

printHistogramFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected