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

Function dumpNameMatcherProfile

src/resolution/name-matcher.ts:2217–2227  ·  view source on GitHub ↗
(label: string)

Source from the content-addressed store, hash-verified

2215
2216/** Dump this thread's matchReference sub-stage table to stderr (no-op unless =2). */
2217export function dumpNameMatcherProfile(label: string): void {
2218 if (!NM_PROFILE || NM_PROFILE.size === 0) return;
2219 const rows = [...NM_PROFILE.entries()]
2220 .map(([k, v]) => ({ k, n: v.n, ms: Number(v.ns / 1_000_000n) }))
2221 .sort((a, b) => b.ms - a.ms);
2222 for (const r of rows) {
2223 console.error(
2224 `[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`
2225 );
2226 }
2227}
2228
2229export function matchReference(
2230 ref: UnresolvedRef,

Callers 1

dumpResolveProfileMethod · 0.90

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected