perf(indexer): an incremental sync reads the whole store
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 22/100
- issue の種類
- リファクタリング
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- go
- 領域
- performance, tooling
調査の方向性
Start in internal/indexer/storeview.go, where loadStoreView reads every node and edge, and follow buildReverseAdjacency and the implements/override synthesis from there. First add the sync benchmark under tools/bench: a large generated corpus with one changed file, reporting time and peak RSS. Done means the benchmark runs and the reads and synthesis in the sync path are cut down, while requireSyncEqualsRun and the 30-commit replay still pass.
索引モデルが issue の本文から書いたものです。
説明
Every codegraph sync that reparses or deletes a file reads the whole store. Its cost therefore grows with the size of the repository, not with the size of the change. The file watcher and the daemon run it after each save, and serve runs it before every MCP handshake.
What a sync reads today (after #192, #195 and #196)
- Every File record: the stat pre-filter (
GetFileper discovered file), the deletion check (IterateFiles) and, when the sync adds a symbol, the waiting-file check (filesWaitingOn). - Every node and every edge, in
loadStoreView(internal/indexer/storeview.go). It builds the store-seeded symbol index and the lookups that resolution and edge synthesis read. - Every
callsedge again when the sync removes a node (buildReverseAdjacency). - Implements and override synthesis over the whole graph, held in memory.
A sync with no changes returns before any of this.
Why it reads everything. Resolving a batch the way a fresh index does needs any symbol a batch file can reference, and any type or interface its edges can match. #196 chose correctness over cost. Nothing measures sync cost today: the perf regression gate (tools/bench) measures a full index, query latency, peak RSS and cold start.
What to do
- Add a sync benchmark to
tools/bench: a large generated corpus, one file changed, time and peak RSS of the sync. - Read on demand, not up front. Look up a node's kind or edges (
GetNode,IterateEdges(source)) as resolution needs them, and cache them for the sync. Looking up a referenced name's symbols the same way needs a store index keyed by module and name, which would be new. - Limit implements and override synthesis to the types and interfaces whose method sets the batch changes, with the stored synthesized edges of those types as the set to compare against.
- Keep the equality tests (
requireSyncEqualsRun, the 30-commit replay in #196) as the check that a cheaper sync still matches a fresh index.
🤖 Generated with Claude Code
- 主要言語
- Go
- スター
- 0
- フォーク
- 0
- 平均マージ
- 7時間 42分
- マージ済み PR(30日)
- 111
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
seanb4t/codegraph-go のほかの issue
-
chore needs-triage
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
seanb4t/codegraph-go#380 ·
メンテナーはふだん 1 日以内に返信
-
chore needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
seanb4t/codegraph-go#379 ·
メンテナーはふだん 1 日以内に返信
-
area:query chore needs-triage spec-needed
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
seanb4t/codegraph-go#377 ·
メンテナーはふだん 1 日以内に返信
-
chore needs-triage
難易度 1/5 1〜3時間 初心者へのやさしさ 84/100
seanb4t/codegraph-go#362 ·
メンテナーはふだん 1 日以内に返信
-
area:query bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
seanb4t/codegraph-go#355 ·
メンテナーはふだん 1 日以内に返信
seanb4t/codegraph-go の issue をすべて見る
似ている issue
-
Add iterate GmbH domains to a dedicated list and include it in company and developer categoriesオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
v2fly/domain-list-community#4307 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 1 日以内に返信
-
notify: voice_queue rows are deleted only at startup, so a hub that stays up grows it without boundオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
mattabate/life-distributable#232 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信