MCPcopy Create free account
hub / github.com/ReactTooltip/react-tooltip / buildMarkdownReport

Function buildMarkdownReport

benchmarks/aggregate-benchmarks.mjs:142–163  ·  view source on GitHub ↗
(result)

Source from the content-addressed store, hash-verified

140}
141
142function buildMarkdownReport(result) {
143 const lines = [
144 '# Aggregated React Tooltip Scaling Benchmark',
145 '',
146 `- Timestamp: ${result.timestamp}`,
147 `- Input files: ${result.inputFiles.length}`,
148 `- Selection: ${result.selection}`,
149 `- Generation filter: ${result.generationFilter}`,
150 `- Counts: ${result.counts.join(', ')}`,
151 '',
152 '| Count | V5 mount | V6 mount | Mount delta | Mount spread | V5 unmount | V6 unmount | Unmount delta | Unmount spread | V5 update | V6 update | Update delta | Update spread | V5 mount mem | V6 mount mem | Mount mem delta | Mount mem spread | V5 unmount mem | V6 unmount mem | Unmount mem delta | Unmount mem spread | Samples | V5 timeouts | V6 timeouts |',
153 '| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |',
154 ]
155
156 result.summary.forEach((row) => {
157 lines.push(
158 `| ${row.count} | ${formatMs(row.v5.mount.median)} | ${formatMs(row.v6.mount.median)} | ${formatMs(row.mountDeltaMs)} | ${formatPercent(row.mountDeltaSpreadPercent)} | ${formatMs(row.v5.unmount.median)} | ${formatMs(row.v6.unmount.median)} | ${formatMs(row.unmountDeltaMs)} | ${formatPercent(row.unmountDeltaSpreadPercent)} | ${formatMs(row.v5.update.median)} | ${formatMs(row.v6.update.median)} | ${formatMs(row.updateDeltaMs)} | ${formatPercent(row.updateDeltaSpreadPercent)} | ${formatBytes(row.v5.mountMemory.median)} | ${formatBytes(row.v6.mountMemory.median)} | ${formatBytes(row.mountMemoryDeltaBytes)} | ${formatPercent(row.mountMemoryDeltaSpreadPercent)} | ${formatBytes(row.v5.unmountMemory.median)} | ${formatBytes(row.v6.unmountMemory.median)} | ${formatBytes(row.unmountMemoryDeltaBytes)} | ${formatPercent(row.unmountMemoryDeltaSpreadPercent)} | ${row.sampleCount} | ${row.v5.timeoutCount} | ${row.v6.timeoutCount} |`,
159 )
160 })
161
162 return `${lines.join('\n')}\n`
163}
164
165async function main() {
166 const inputFiles = await resolveInputFiles()

Callers 1

mainFunction · 0.70

Calls 3

formatMsFunction · 0.70
formatPercentFunction · 0.70
formatBytesFunction · 0.70

Tested by

no test coverage detected