Skip to content

perf(architecture): ask codegraph once per repeated name - #41

Merged
inth3shadows merged 1 commit into
masterfrom
arch-cache-callees-probes
Sep 27, 2026
Merged

inth3shadows merged 1 commit into
masterfrom
arch-cache-callees-probes

Conversation

@inth3shadows

Copy link
Copy Markdown
Owner

Follow-up (b) from #39's review.

N same-named symbols ran N identical callees probes, plus identical node -f probes on npm when a name repeated within a file. probeFileEdges now wraps run in memoizeRepeatedNames: for a name that occurs more than once, the answer is cached under the full args, so callees is asked once per name and node -f once per name+file. Names that occur once go straight through, so memory holds only answers that are read again.

No output change: every symbol reads the same answer it would have fetched.

New test: three runs across two files plus one solo symbol → 4 codegraph calls (was 6), with the same edges and unresolved names.

Local: node test/run.js 176 passed, 0 failed (fork codegraph).

Same-named symbols sent identical callees probes (and identical node -f
probes for a repeated name+file on npm). probeFileEdges now memoizes run
for names that occur more than once, keyed by the full args, so each
distinct question is asked once. Single-occurrence names are not cached.
@inth3shadows
inth3shadows merged commit 8a0b9d5 into master Sep 27, 2026
7 checks passed
@inth3shadows
inth3shadows deleted the arch-cache-callees-probes branch September 27, 2026 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant