From 94587835e7e8c91dac5ed78d9464b597252192a7 Mon Sep 17 00:00:00 2001 From: Alessandro Decina Date: Tue, 5 Nov 2024 13:41:34 +0000 Subject: [PATCH] program-runtime: double program cache size 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. --- program-runtime/src/loaded_programs.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program-runtime/src/loaded_programs.rs b/program-runtime/src/loaded_programs.rs index 181f5280db71d6..f8a0f2534b472f 100644 --- a/program-runtime/src/loaded_programs.rs +++ b/program-runtime/src/loaded_programs.rs @@ -33,7 +33,7 @@ use { }; pub type ProgramRuntimeEnvironment = Arc>>; -pub const MAX_LOADED_ENTRY_COUNT: usize = 256; +pub const MAX_LOADED_ENTRY_COUNT: usize = 512; pub const DELAY_VISIBILITY_SLOT_OFFSET: Slot = 1; /// Relationship between two fork IDs @@ -1624,7 +1624,7 @@ mod tests { assert_eq!(num_tombstones, num_tombstones_expected); // Evict entries from the cache - let eviction_pct = 2; + let eviction_pct = 1; let num_loaded_expected = Percentage::from(eviction_pct).apply_to(crate::loaded_programs::MAX_LOADED_ENTRY_COUNT); @@ -1707,7 +1707,7 @@ mod tests { assert_eq!(num_tombstones, num_tombstones_expected); // Evict entries from the cache - let eviction_pct = 2; + let eviction_pct = 1; let num_loaded_expected = Percentage::from(eviction_pct).apply_to(crate::loaded_programs::MAX_LOADED_ENTRY_COUNT);