Repository navigation
perf: 消除重复图遍历与输出查找 - #517
Merged
Luo-root merged 1 commit intoOct 30, 2026
Merged
Conversation
This was referenced Oct 28, 2026
Merged
Merged
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.
关联 Issue
见 #516。本 PR 是两份后续修复的第一份,不能单独关闭 Issue;基于尚未合并的 #515。
改了什么
共享 Graph 定义导致挂载环可达性搜索指数重复访问;宽输出节点与 Mermaid 接线反复扫描声明;检查点元数据枚举在每层拷贝完整后代结果。
本次对定义可达性去重,为多输出写权限和 Mermaid 接线建立索引,并用同一结果累加检查点元数据。真实挂载位置仍保持独立。环见证顺序/文本、类型权限、声明顺序、返回容器隔离和 Mermaid 输出保持兼容。
新增
新增私有索引和算法回归/规模测试;没有新增公开 API、依赖或预期运行语义变化。单输出节点不分配权限 map。
影响范围
Mermaid 用临时索引减少重复查找,同时增加每次渲染分配;完整挂载路径仍是元数据输出成本的一部分。失败来源 Stop 语义和存储绘图统计不在本次范围。
测试
Go 1.26.10、Windows amd64;
GOWORK=off GOTOOLCHAIN=local。go build ./...、go vet ./...、工具链 gofmt、Core 仅标准库依赖闭包,以及go test -race -count=1 -timeout=180s ./...均通过。go test -race -count=3 -timeout=90s -run '^Test(Mermaid|OutputPermissions|UndeclaredWrite|NewNodeCopiesDeclarations|SetSkipConflict|Linear)' .通过。同输入规模检查
合成测试,同机器,
CPU=1、benchtime=100ms、count=3,取中位数;不是生产吞吐结果。审查关注点
已访问表示跳过,不表示出现环;定义去重不能用于挂载实例元数据。重点检查类型权限报错、渲染首条匹配和绑定声明顺序。
自审
已检查差异与前后对照,写明 Mermaid 的时间/空间取舍;未提交凭据,未改发布状态。