HermitCrab shapes: build the node map inside Shape.CopyTo's copy pass (no isolated measurement)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 48/100
- Issue 类型
- 重构
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- csharp
- 领域
- performance
调研方向
Read the linked optimization record and ledger first to understand the archived change and its status. Measure the map-building change alone in allocations per shape copy, then run ShapeCopyToTests for empty ranges, annotation remapping, and copy independence. Done means the tests pass and the standalone measurement is recorded without claiming a ratio that was not measured.
由索引模型根据 Issue 内容生成。
描述
Shape.CopyTo copies the nodes of a range, then builds the source-to-copy node map in a second pass with Zip and ToDictionary, so that annotations can be remapped. The source and destination nodes are already visited in matching order during cloning, so the loop can record the mapping as it goes. The change allocates the map on the first node of a nonempty range and fills it in the copy pass, and skips the map for an empty range. It removes one enumeration and one LINQ dictionary from each annotated shape copy. The change is on the archived branch perf/hc-optimization-archive.
Measured. Nothing in isolation. It was timed only together with shape copy-on-write and the feature-structure clone work, so no standalone ratio is claimed.
What a revival must do first. Measure it alone, in allocations per shape copy. Keep ShapeCopyToTests (empty ranges, leaf and spanning annotations, remapping, independence of the copy).
Record: https://github.com/sillsdev/machine/blob/2eba2f502338705a4d529d7034cecb6303db7f35/docs/optimizations/shape-copy-single-pass-map.md
Ledger: https://github.com/sillsdev/machine/blob/2eba2f502338705a4d529d7034cecb6303db7f35/docs/hermitcrab-optimization-ledger.md; disposition: https://github.com/sillsdev/machine/blob/2eba2f502338705a4d529d7034cecb6303db7f35/docs/hermitcrab-perf-2026-09-disposition.md
From #490 (closed).
- 主要语言
- C#
- 星标
- 29
- 派生
- 16
- 平均合并
- 5 天 20 小时
- 30 天内合并 PR
- 11
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
sillsdev/machine 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
porting
难度 3/5 半天 新手友好度 25/100
sillsdev/machine#617 · 1 条评论 ·
维护者通常 1 天内回复
-
Hermit Crab
难度 4/5 3-5 天 新手友好度 18/100
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 62/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
RadicalCSG/com.chisel#192 ·
维护者通常 1 天内回复
-
area-testing p2-post-1.0 technical-debt
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
Bug good first issue
难度 2/5 1-3 小时 新手友好度 72/100
RazorConsole/RazorConsole#447 ·
维护者通常 1 天内回复
-
CloudEventsMiddleware decodes JSON string data for `+json` content types可能已有人在做 @RaphaelFakhri 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
dapr/dotnet-sdk#1964 ·
维护者通常 1 天内回复
-
bug P3
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复