Skip to content

Turbopack: commit compaction only when there are updates #78651

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions turbopack/crates/turbo-persistence/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -571,12 +571,14 @@ impl TurboPersistence {
)?;
}

self.commit(
new_sst_files,
Vec::new(),
indicies_to_delete,
*sequence_number.get_mut(),
)?;
if !new_sst_files.is_empty() {
self.commit(
new_sst_files,
Vec::new(),
indicies_to_delete,
*sequence_number.get_mut(),
)?;
}

self.active_write_operation.store(false, Ordering::Release);

Expand All @@ -592,9 +594,9 @@ impl TurboPersistence {
indicies_to_delete: &mut Vec<usize>,
max_coverage: f32,
max_merge_sequence: usize,
) -> Result<bool> {
) -> Result<()> {
if static_sorted_files.is_empty() {
return Ok(false);
return Ok(());
}

struct SstWithRange {
Expand Down Expand Up @@ -869,7 +871,7 @@ impl TurboPersistence {
indicies_to_delete.append(&mut inner_indicies_to_delete);
}

Ok(true)
Ok(())
}

/// Get a value from the database. Returns None if the key is not found. The returned value
Expand Down
Loading