Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Analysis catalog takes seconds to open on large drafts

Đang mở
#503 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ó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
52/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
performance

Hướng nghiên cứu

Start in selectCatalogRows, buildCatalogRows, deriveFacets, and applyCatalogQuery to trace the catalog work described in the issue. Compare the measured costs and consider the three proposed approaches; the issue does not identify test files or a preferred fix. Done means catalog opening and edits avoid the reported multi-second rebuild while preserving correct rows and sorting.

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

Mô tả

Problem

On a large project, switching the side panel from Concordance to the Analysis catalog takes about 4 seconds. Switching the other way is instant.

Steps to reproduce

  1. Open a project with a large interlinear draft.
  2. Open the side panel on Concordance.
  3. Switch to the Analysis catalog.

Cause

The concordance's entries are built in SourceTextProvider, above the side panel. Showing the concordance only renders entries that already exist.

The catalog builds its rows when it mounts. selectCatalogRows calls buildCatalogRows, which goes through every token-analysis link in the draft:

  • It parses each approved and stale link's token ref (parseUsage).
  • It sorts each analysis's usages with compareDocumentOrder, which calls Canon.bookIdToNumber twice per comparison.
  • It builds folded search text for each analysis. This is cached per record.

On every mount, the panel also runs deriveFacets and sorts the full list with applyCatalogQuery.

Measurements

From a synthetic benchmark with 30k analyses and 300k approved links across 66 books:

Step Time
buildCatalogRows 0.9–2.3 s
deriveFacets ~80 ms
applyCatalogQuery (default sort) 140–200 ms

When it recurs

selectCatalogRows keeps its result between visits. Reopening the catalog with no edits in between should cost only the facets and the sort.

Any write to analyses or links invalidates that result. The next open pays for a full rebuild.

While the catalog is open, the rebuild also runs after every analysis edit, such as committing a gloss. On large drafts this probably shows up as lag after each edit.

Possible fixes

  • Update the rows incrementally, so an edit rebuilds only the analyses it touched.
  • Store each usage's book number when it is parsed, so the sort doesn't look it up on every comparison.
  • Keep the catalog mounted while it is hidden. This only helps when nothing was edited in between.
Ngôn ngữ chính
TypeScript
Star
2
Fork
0
Merge trung bình
1 ngày 23 giờ
Pull request đã merge (30 ngày)
57

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

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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/interlinearizer-extension

Tất cả issue của sillsdev/interlinearizer-extension

Issue tương tự

Thêm issue về TypeScript

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.