HermitCrab shapes: build the node map inside Shape.CopyTo's copy pass (no isolated measurement)

オープン
#592 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
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 の本文から書いたものです。

説明

Hermit Crab performance

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日 21時間
マージ済み PR(30日)
9

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

sillsdev/machine のほかの issue

sillsdev/machine の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。