Commit 2cb0707
committed
Reduce peak memory during edge grouping
Delete edges from the input map while iterating to free memory
as the grouped map is built. This halves peak memory usage during
groupEdgesByIdentityDigest (~1.4GB to ~700MB with ~1M edges).
Safe because Go allows map deletion during range, and all callers
do not use the edges map after grouping.
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>1 parent d4afa36 commit 2cb0707
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
548 | 548 | | |
549 | 549 | | |
550 | 550 | | |
| 551 | + | |
| 552 | + | |
551 | 553 | | |
552 | 554 | | |
553 | 555 | | |
| |||
0 commit comments