MCPcopy
hub / github.com/exceljs/exceljs / testWrite

Function testWrite

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

Source from the content-addressed store, hash-verified

6const SIZE = 1048576;
7
8function testWrite(results) {
9 const a = [];
10
11 function test(size) {
12 return function() {
13 console.log(`Write: ${size}`);
14 const text = utils.randomName(size);
15 const sb = new StringBuf({size: SIZE + 10});
16 const sw = new HrStopwatch();
17 sw.start();
18 while (sb.length < SIZE) {
19 sb.addText(text);
20 }
21 sw.stop();
22 a.push(`${size}:${Math.round(sw.span * 1000)}`);
23 };
24 }
25
26 return Promise.resolve()
27 .then(test(1))
28 .delay(1000)
29 .then(test(2))
30 .delay(1000)
31 .then(test(4))
32 .delay(1000)
33 .then(test(8))
34 .delay(1000)
35 .then(test(16))
36 .delay(1000)
37 .then(test(32))
38 .delay(1000)
39 .then(test(64))
40 .delay(1000)
41 .then(() => {
42 results.write = a.join(', ');
43 return results;
44 });
45}
46
47function testGrow(results) {
48 const a = [];

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…