Repository navigation
docs: twelve-repository sync, query and graph benchmarks / 十二仓库增量同步、查询与图谱一致性数据 - #17
Merged
NianJiuZst merged 2 commits intoNov 2, 2026
Merged
Conversation
Replace the six-repository edb403e table, the second-phase table and the b827b1d sync/query tables in both READMEs with one twelve-repository set measured on cd69b83 against upstream d2e0389: full index, incremental CLI sync, query latency and graph agreement, all on one machine and configuration. Add the structured evidence.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
用合并后的
maincd69b83对照原版d2e0389,测了全部 12 个仓库的全量索引、增量同步、查询延迟和精确率/召回率,替换README.md和README.zh-CN.md中"实测性能"一节的旧数据。只改文档,没有代码改动。edb403e全量索引表、"Second-phase languages" 小节(数据并入新表)、b827b1d的增量同步表和查询延迟表(只有 4 个仓库,且来自另一台机器)。docs/benchmarks/2026-11-02-twelve-repo.json:全部样本、查询列表、cgr sync报告、分类型边数和配置。docs/BENCHMARKS*.md和docs/benchmarks/2026-11-01-*.json作为历史记录保留,没有删。Summary
Measures full indexing, incremental CLI sync, query latency and graph agreement for all twelve repositories with merged
maincd69b83against upstreamd2e0389, and replaces the old data in the "Measured performance" sections of both READMEs. Documentation only.edb403etable, the "Second-phase languages" subsection (folded into the new tables), and the four-repositoryb827b1dsync and query tables, which came from a different machine.docs/benchmarks/2026-11-02-twelve-repo.jsonwith every sample, query list,cgr syncreport, per-kind edge count and the configuration.docs/BENCHMARKS*.mdreports anddocs/benchmarks/2026-11-01-*.jsonstay as history.测试配置 / Configuration
cgrcd69b83,cargo build --release --locked -p cgr(fat LTO,codegen-units = 1), rustc 1.99.1 (58cf8f9c3 2026-10-13); binary SHA-256906cf11f3abc67d4790364c19d601068b1459cbc115616e2a58548eefcc9c9ebd2e0389, productiondist/with thelinux-x64native kernel prebuild; Node v24.18.0 asnode --liftoff-only --disable-warning=ExperimentalWarningCGR_THREADS=2,CGR_MEMORY_MB=2048,CODEGRAPH_PARSE_WORKERS=2,CODEGRAPH_RESOLVE_WORKERS=2, telemetry off (restricted tier, same asdocs/BENCHMARKS.md)wait4/ one command at a time, ≥ 30 s gap, ≥ 6 GiB available, warm caches, wall time includes process start/exit, peak RSS fromwait4f4b9685,它与cd69b83源码相同,只差 README / 1 warmup + 3 timed rebuilds per side, alternating; samples fromf4b9685, source-identical tocd69b83docs/BENCHMARKS.md中的文件和符号,其余 8 个仓库各选一个核心源文件 / no change, comment edit, single-file rename; 3 timed runs per category and side; original bytes restored after each category; Express/Gin/Tokio/Django reuse the files and symbols fromdocs/BENCHMARKS.mddocs/benchmarks/2026-11-01-main-retest.json的问题,其余 8 个仓库按相同形式用固定种子从生产代码的函数/方法/类型名生成 / warm: 20 fixed queries, 8 warm-up, then 20 × 3 in-process; CLI: first query × 3; four repos reuse the existing query lists, eight use seeded queries of the same shape(源稳定 ID, 目标稳定 ID, 类型, 行, UTF-16 列);P = 共有 /cgr,R = 共有 / 原版;门槛 P ≥ 97%、R ≥ 95% / edge key(src stable ID, dst stable ID, kind, line, UTF-16 column); gate P ≥ 97%, R ≥ 95%结果 / Results
等权几何平均加速比 / Equal-weight geometric-mean speedups:
cgr status --verify --strict返回 0,cgr debug diff输出 identical。 / In all twelve repositories both sides return to their initial strict edge sets after restoration, andcgr status --verify --strictandcgr debug diffpass.需要注意 / Notes
cgr sync标记的受影响引用超过 30% 上限,因此重建了完整索引;例如 Tokio 65,414 个引用中有 62,419 个被标记。Tokio 因此比原版慢(753.5 → 897.4 ms,0.84×)。Tokio 和 Express 用的编辑与已删除的b827b1d表相同:旧表中 Tokio 改名只要 71.4 ms,远低于旧 README 里 Tokio 的全量索引(edb403e,555.3 ms),说明当时走的是增量同步;在cd69b83上同一编辑退回了全量重建。由于其他任务暂停,这次没有调查原因。README 中这些格子用 † 标出。Single-file renames can fall back to a full rebuild. In 8 of 12 repositories the rename marks more than 30% of references as affected (Tokio: 62,419 of 65,414), so
cgr syncrebuilds the index, and Tokio is slower than upstream (0.84×). Tokio and Express use the same edit as the removedb827b1dtable, where the Tokio rename took 71.4 ms, far below the old README's Tokio full index (edb403e, 555.3 ms), so it was incremental; atcd69b83it falls back to a full rebuild. Not investigated here; marked † in the README.cgr统计 UTF-8 字节。 / Upstream answer sizes are UTF-16 code units;cgrsizes are UTF-8 bytes.