MCPcopy Index your code
hub / github.com/python/cpython / recalculateValue

Function recalculateValue

Lib/profiling/sampling/_flamegraph_assets/flamegraph.js:1217–1224  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

1215 }
1216
1217 function recalculateValue(node) {
1218 if (!node.children || node.children.length === 0) {
1219 return node.value || 0;
1220 }
1221 const childrenValue = node.children.reduce((sum, child) => sum + recalculateValue(child), 0);
1222 node.value = Math.max(node.value || 0, childrenValue);
1223 return node.value;
1224 }
1225
1226 const filteredRoot = { ...data, children: [] };
1227

Callers 1

filterDataByThreadFunction · 0.85

Calls 2

reduceMethod · 0.80
maxMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…