Repository navigation
perf(compiler): share distinct interface async edges - #215
Merged
Merged
Conversation
…struction and coloring Build the adjacency from each implementation to the interface methods it colors once, skipping repeated edges as they appear, and let coloring read that relation instead of rebuilding it from a flat slice of every mark. Signed-off-by: Christian Stewart <[email protected]>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The refactor preserves existing propagation semantics while removing redundant marks and indexing.
0 open findings
What changed in this PR
This PR reduces memory and indexing overhead during interface async coloring by sharing distinct implementation-to-interface edges.
Changes:
- Deduplicates interface async edges during semantic model construction.
- Lets async coloring consume the shared edge map directly.
| File | Description |
|---|---|
compiler/semantic-model.go |
Builds distinct async interface edges. |
compiler/semantic-async.go |
Defines and consumes the shared edge map. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Interface async coloring built one mark per implementation and interface method pair, 3.9 million marks over 62,690 distinct edges on the Spacewave tree. The compiler now builds the distinct edges once per implementation and coloring reads them directly, so the flat mark slice and its second indexing pass are gone. A leaf edit on the Spacewave tree compiles in 1.951 s instead of 2.127 s on a quiet host, and a cold compile of the 13 patterns produces byte-identical output.