Skip to content

perf(leiden): bound memory of supernode aggregation - #80

Merged
adsharma merged 2 commits into
Ladybug-Memory:mainfrom
AnoldGH:pr1-view-memory
Oct 29, 2026
Merged

adsharma merged 2 commits into
Ladybug-Memory:mainfrom
AnoldGH:pr1-view-memory

Conversation

@AnoldGH

@AnoldGH AnoldGH commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Supernodes with more than ICEBUG_VIEW_STAGE_CAP (default 2^16) staged entries are aggregated in a thread-local std::unordered_map instead of the edge-sized staging buffer, and neighbor vectors are now allocated at exact size to minimize memory usage.

@adsharma
adsharma self-requested a review October 29, 2026 00:33

@adsharma adsharma left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fixes!

AnoldGH and others added 2 commits October 28, 2026 19:20
Supernodes with more than ICEBUG_VIEW_STAGE_CAP (default 2^16) staged
entries are aggregated in a thread-local std::unordered_map instead of
the edge-sized staging buffer. Neighbor vectors are now allocated at
exact size to minimize memory usage.
- Wrap stage-cap comment to satisfy clang-format (100-col limit).
- Hoist aggregationWork() out of aggregateNeighbors(): callers
  (computeNeighbors, ensureEagerCache) compute the O(members) estimate
  once and pass it through for the stage-cap branch and eager-cache
  eligibility, avoiding 2-3 passes over supernodeToOriginal[supernode].
  Estimate is computed outside the cache-mutex since the mapping is
  read-only.
@adsharma
adsharma merged commit eef7d17 into Ladybug-Memory:main Oct 29, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants