MCPcopy Create free account
hub / github.com/nodejs/node / dumpProfile

Function dumpProfile

deps/v8/tools/wasm/wasm-import-profiler.js:40–54  ·  view source on GitHub ↗
(profile)

Source from the content-addressed store, hash-verified

38 }
39
40 function dumpProfile(profile) {
41 let array = [];
42 for (let key in profile) {
43 if (key == "instanceNum") continue;
44 let data = profile[key];
45 if (data.count == 0) continue;
46 array.push(data);
47 }
48 print(`--- Import profile for instance ${profile.instanceNum} ---`);
49 if (array.length == 0) return;
50 array.sort((a, b) => b.total - a.total);
51 for (let data of array) {
52 print(`${padl(data.name, 30)}: ${padr(data.count, 10)} ${padp(data.total, 10)}ms`);
53 }
54 }
55
56 function padl(s, len) {
57 s = s.toString();

Callers 1

Calls 6

padlFunction · 0.85
padrFunction · 0.85
padpFunction · 0.85
sortMethod · 0.80
printFunction · 0.50
pushMethod · 0.45

Tested by

no test coverage detected