Skip to content

Commit 248e0c7

Browse files
v2.1: program-runtime: double program cache size (backport of #3481) (#3492)
program-runtime: double program cache size (#3481) The cache is currently getting thrashed and programs are getting reloaded pretty much at every single slot. Double the cache size, which makes reloading happen only due to random eviction sometimes picking a popular entry. The JIT code size with the new cache size is about 800MB. This change reduces jit time 15x. (cherry picked from commit fb4adda) Co-authored-by: Alessandro Decina <[email protected]>
1 parent c6a7130 commit 248e0c7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

program-runtime/src/loaded_programs.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use {
3333
};
3434

3535
pub type ProgramRuntimeEnvironment = Arc<BuiltinProgram<InvokeContext<'static>>>;
36-
pub const MAX_LOADED_ENTRY_COUNT: usize = 256;
36+
pub const MAX_LOADED_ENTRY_COUNT: usize = 512;
3737
pub const DELAY_VISIBILITY_SLOT_OFFSET: Slot = 1;
3838

3939
/// Relationship between two fork IDs
@@ -1624,7 +1624,7 @@ mod tests {
16241624
assert_eq!(num_tombstones, num_tombstones_expected);
16251625

16261626
// Evict entries from the cache
1627-
let eviction_pct = 2;
1627+
let eviction_pct = 1;
16281628

16291629
let num_loaded_expected =
16301630
Percentage::from(eviction_pct).apply_to(crate::loaded_programs::MAX_LOADED_ENTRY_COUNT);
@@ -1707,7 +1707,7 @@ mod tests {
17071707
assert_eq!(num_tombstones, num_tombstones_expected);
17081708

17091709
// Evict entries from the cache
1710-
let eviction_pct = 2;
1710+
let eviction_pct = 1;
17111711

17121712
let num_loaded_expected =
17131713
Percentage::from(eviction_pct).apply_to(crate::loaded_programs::MAX_LOADED_ENTRY_COUNT);

0 commit comments

Comments
 (0)