Repository navigation
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 17 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 794c3f2561
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for _, candidate := range lowerNeighbors { | ||
| if _, exists := neighbors[candidate]; exists { |
There was a problem hiding this comment.
Avoid scanning the larger adjacency for every intersection
For graphs with high-degree hubs, always scanning lowerNeighbors introduces a quadratic runtime regression. Consider a star with n leaves whose hub has the largest vertex ID: each leaf now scans all n entries in the hub's lower-neighbor slice, making step 2 perform Θ(n²) membership checks even though there are no triangles. The previous findCross scanned the smaller set, so the same graph required only Θ(n) checks. Preserve a smaller-side intersection strategy, for example by sorting the exchanged slices and using binary searches when the local neighbor set is smaller, so compact exchange does not make sparse hub-heavy graphs impractical to process.
Useful? React with 👍 / 👎.
|
已完成与 #30 的逐文件、算法语义和回归测试对比,保留 #30 作为主方案:
因此关闭本 PR,避免两套 triangle-count 实现并行维护;没有丢失独有测试或有效语义。 |
背景
triangle_count当前把每个顶点的低 ID 邻居保存为 Go map,并在 step 1 后复制到每个 worker。大图上会形成“每个 worker 一份整图 map 对象”的高额对象数、桶空间与 GC 压力;step 2 结束后这些邻接结构还会一直保留到输出完成。方案
SliceUint32跨 worker 交换;N(v) ∩ lower(f),每个 incident triangle 对 v 恰好计数一次;回归覆盖
范围
后续性能边界
本 PR 优先消除确定性的 map 复制和 GC 放大,同时保持两步计算与原结果语义。按 degree/rank 定向可进一步降低高阶图交集次数,但需要额外 superstep 或新的交换结构,需在真实图上测量后单独设计。
ASF 上游将使用同一 head 分支同步提交。
ASF upstream: apache#379