(results)
| 45 | } |
| 46 | |
| 47 | function 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 | |
| 86 | const results = {}; |
| 87 | Promise.resolve(results) |
nothing calls this directly
no test coverage detected
searching dependent graphs…