MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / section

Function section

scripts/memwaste-report.py:348–360  ·  view source on GitHub ↗
(title, kinds, sort_key, cols)

Source from the content-addressed store, hash-verified

346 f"{w['aux2']:>9,} {names.get(a, a)[:90]}")
347
348 def section(title, kinds, sort_key, cols):
349 rows = [(k, a, w) for (k, a), w in p["work"].items() if k in kinds]
350 if not rows:
351 return
352 print()
353 print(f" CPU — {title}")
354 print(" " + " ".join(f"{c[0]:>{c[1]}}" for c in cols) + " site")
355 for k, a, w in sorted(rows, key=lambda t: (-sort_key(t[2]), t[1]))[:args.top]:
356 cells = []
357 for c in cols:
358 v = c[2](k, w)
359 cells.append(f"{v:>{c[1]}}" if isinstance(v, str) else f"{v:>{c[1]},.0f}")
360 print(" " + " ".join(cells) + f" {names.get(a, a)[:90]}")
361
362 section("byte work (mem*/str*) by bytes", BYTE_KINDS, lambda w: w["bytes"],
363 [("kind", 8, lambda k, w: k), ("calls", 12, lambda k, w: w["calls"]),

Callers 3

mainFunction · 0.70
compat_thread.cFile · 0.50
mainFunction · 0.50

Calls 1

getMethod · 0.65

Tested by 1

mainFunction · 0.40