MCPcopy Create free account
hub / github.com/handsontable/handsontable / formatOutput

Function formatOutput

performance-tests/trace-parser.mjs:1013–1064  ·  view source on GitHub ↗
(stats, options = {})

Source from the content-addressed store, hash-verified

1011}
1012
1013export function formatOutput(stats, options = {}) {
1014 const { rangeStart, rangeEnd, categories, updateCounters, runs } = stats;
1015 const { full = false } = options;
1016
1017 const round = v => Math.round(v || 0);
1018
1019 if (runs != null) {
1020 console.log(`Average across ${runs} trace file(s)`);
1021 console.log('');
1022 }
1023
1024 console.log(`Range: ${rangeStart} ms – ${rangeEnd} ms`);
1025 console.log('');
1026 console.log(`System ${round(categories.other)} ms`);
1027 console.log(`Scripting ${round(categories.scripting)} ms`);
1028 console.log(`Rendering ${round(categories.rendering)} ms`);
1029 console.log(`Loading ${round(categories.loading)} ms`);
1030 console.log(`Painting ${round(categories.painting)} ms`);
1031 console.log(`Experience ${round(categories.experience)} ms`);
1032
1033 if (full || round(categories.messaging)) {
1034 console.log(`Messaging ${round(categories.messaging)} ms`);
1035 }
1036 if (full || round(categories.gpu)) {
1037 console.log(`GPU ${round(categories.gpu)} ms`);
1038 }
1039 if (full || round(categories.async)) {
1040 console.log(`Async ${round(categories.async)} ms`);
1041 }
1042 console.log(`Idle ${round(categories.idle)} ms`);
1043 console.log('');
1044 console.log(`Total ${rangeEnd} ms`);
1045
1046 if (updateCounters) {
1047 const u = updateCounters;
1048
1049 console.log('');
1050 console.log(
1051 runs != null ? 'UpdateCounters (main frame, averaged)' : 'UpdateCounters (main frame)',
1052 );
1053 const cell = v => (v == null ? '—' : String(v));
1054
1055 console.log(`Min JS heap ${u.jsHeapMinLabel}`);
1056 console.log(`Max JS heap ${u.jsHeapMaxLabel}`);
1057 console.log(`Min Documents ${cell(u.documentsMin)}`);
1058 console.log(`Max Documents ${cell(u.documentsMax)}`);
1059 console.log(`Min Nodes ${cell(u.nodesMin)}`);
1060 console.log(`Max Nodes ${cell(u.nodesMax)}`);
1061 console.log(`Min Listeners ${cell(u.listenersMin)}`);
1062 console.log(`Max Listeners ${cell(u.listenersMax)}`);
1063 }
1064}
1065
1066const isMain =
1067 process.argv[1] &&

Callers 1

trace-parser.mjsFile · 0.85

Calls 2

cellFunction · 0.85
roundFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…