Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d7595d2

Browse files
committed
create smaller initial files to reduce memory usage
1 parent 7cc6c22 commit d7595d2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

turbopack/crates/turbo-persistence/src/constants.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ pub const MAX_MEDIUM_VALUE_SIZE: usize = 64 * 1024 * 1024;
66
pub const MAX_SMALL_VALUE_SIZE: usize = 64 * 1024 - 1;
77

88
/// Maximum number of entries per SST file
9-
pub const MAX_ENTRIES_PER_INITIAL_FILE: usize = 1024 * 1024;
9+
pub const MAX_ENTRIES_PER_INITIAL_FILE: usize = 256 * 1024;
1010

1111
/// Maximum number of entries per SST file
1212
pub const MAX_ENTRIES_PER_COMPACTED_FILE: usize = 1024 * 1024;
1313

1414
/// Finish file when total amount of data exceeds this
15-
pub const DATA_THRESHOLD_PER_INITIAL_FILE: usize = 256 * 1024 * 1024;
15+
pub const DATA_THRESHOLD_PER_INITIAL_FILE: usize = 64 * 1024 * 1024;
1616

1717
/// Finish file when total amount of data exceeds this
1818
pub const DATA_THRESHOLD_PER_COMPACTED_FILE: usize = 256 * 1024 * 1024;

turbopack/crates/turbo-tasks-backend/src/database/turbo.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ use crate::database::{
1313
write_batch::{BaseWriteBatch, ConcurrentWriteBatch, WriteBatch, WriteBuffer},
1414
};
1515

16-
const COMPACT_MAX_COVERAGE: f32 = 10.0;
17-
const COMPACT_MAX_MERGE_SEQUENCE: usize = 16;
16+
const COMPACT_MAX_COVERAGE: f32 = 20.0;
17+
const COMPACT_MAX_MERGE_SEQUENCE: usize = 64;
1818
const COMPACT_MAX_MERGE_SIZE: usize = 512 * 1024 * 1024; // 512 MiB
1919

2020
pub struct TurboKeyValueDatabase {

0 commit comments

Comments
 (0)