MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / dumpResolveProfile

Method dumpResolveProfile

src/resolution/index.ts:2602–2614  ·  view source on GitHub ↗

Dump the CODEGRAPH_RESOLVE_PROFILE histogram to stderr (no-op when off).

(label: string)

Source from the content-addressed store, hash-verified

2600
2601 /** Dump the CODEGRAPH_RESOLVE_PROFILE histogram to stderr (no-op when off). */
2602 dumpResolveProfile(label: string): void {
2603 if (!this.resolveProfile || this.resolveProfile.size === 0) return;
2604 const rows = [...this.resolveProfile.entries()]
2605 .map(([k, v]) => ({ k, n: v.n, ms: Number(v.ns / 1_000_000n) }))
2606 .sort((a, b) => b.ms - a.ms);
2607 for (const r of rows) {
2608 console.error(
2609 `[resolve-profile] ${label} ${r.k}: n=${r.n} total=${(r.ms / 1000).toFixed(1)}s avg=${((r.ms * 1000) / Math.max(1, r.n)).toFixed(0)}µs`
2610 );
2611 }
2612 // =2 only: this thread's matchReference sub-stage table rides along.
2613 dumpNameMatcherProfile(label);
2614 }
2615
2616 resolveListForAdmission(refs: UnresolvedReference[]): {
2617 resolved: ResolvedRef[];

Callers 2

resolver-worker.tsFile · 0.80

Calls 3

NumberInterface · 0.85
mapMethod · 0.80
errorMethod · 0.65

Tested by

no test coverage detected