Commit c6f8a33
committed
Make bulk SF trim O(S) with a single range removal in drainTrimmable
drainTrimmable retired fully-acked sealed segments with per-element
remove(0), shifting the remaining suffix on every iteration -- a bulk
trim of S segments cost O(S^2) element moves. Collect the eligible
prefix first, then remove it with one ObjList.remove(0, eligible - 1)
range removal (inclusive bounds), all under the same monitor as
before, so the I/O thread's snapshotSealedSegments() still cannot
observe a partially shifted list.
Covered by the existing multi-segment bulk-drain assertion in
SegmentRingTest.1 parent 76db2e0 commit c6f8a33
1 file changed
Lines changed: 11 additions & 4 deletions
Lines changed: 11 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
573 | 573 | | |
574 | 574 | | |
575 | 575 | | |
576 | | - | |
577 | | - | |
578 | | - | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
579 | 583 | | |
580 | 584 | | |
581 | 585 | | |
| |||
584 | 588 | | |
585 | 589 | | |
586 | 590 | | |
587 | | - | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
588 | 595 | | |
589 | 596 | | |
590 | 597 | | |
| |||
0 commit comments