Skip to content

Commit

Permalink
leveled compaction: only consider best trivial move
Browse files Browse the repository at this point in the history
  • Loading branch information
marvin-j97 committed Dec 20, 2024
1 parent 72f69fd commit 13d7252
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/compaction/leveled.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ fn pick_minimal_compaction(
}
}

// NOTE: Find trivial moves
for size in (1..=curr_level.len()).rev() {
// NOTE: Find largest trivial move (if it exists)
'trivial_move_search: for size in (1..=curr_level.len()).rev() {
let windows = curr_level.windows(size);

for window in windows {
Expand All @@ -136,6 +136,7 @@ fn pick_minimal_compaction(
segment_ids,
can_trivial_move: true,
});
break 'trivial_move_search;
}
}
}
Expand Down

0 comments on commit 13d7252

Please sign in to comment.