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

Đang mở
#592 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
48/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
csharp
Lĩnh vực
performance

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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).

Ngôn ngữ chính
C#
Star
29
Fork
16
Merge trung bình
5 ngày 21 giờ
Pull request đã merge (30 ngày)
9

Chuẩn bị môi trường

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của sillsdev/machine

Tất cả issue của sillsdev/machine

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.