MCPcopy
hub / github.com/exceljs/exceljs / testGrow

Function testGrow

test/testStringBuf.js:47–84  ·  view source on GitHub ↗
(results)

Source from the content-addressed store, hash-verified

45}
46
47function testGrow(results) {
48 const a = [];
49
50 function test(size) {
51 return function() {
52 console.log(`Grow: ${size}`);
53 const text = utils.randomName(size);
54 const sb = new StringBuf({size: 8});
55 const sw = new HrStopwatch();
56 sw.start();
57 while (sb.length < SIZE) {
58 sb.addText(text);
59 }
60 sw.stop();
61 a.push(`${size}:${Math.round(sw.span * 1000)}`);
62 };
63 }
64
65 return Promise.resolve()
66 .then(test(1))
67 .delay(1000)
68 .then(test(2))
69 .delay(1000)
70 .then(test(4))
71 .delay(1000)
72 .then(test(8))
73 .delay(1000)
74 .then(test(16))
75 .delay(1000)
76 .then(test(32))
77 .delay(1000)
78 .then(test(64))
79 .delay(1000)
80 .then(() => {
81 results.grow = a.join(', ');
82 return results;
83 });
84}
85
86const results = {};
87Promise.resolve(results)

Callers

nothing calls this directly

Calls 1

testFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…