From ff9dc11a38d4df34ef420a7edd20a1317880add2 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sat, 24 Feb 2024 15:06:22 +1000 Subject: [PATCH] CPU/CodeCache: Increase frame delta for manual protected blocks Reduces stutter in Wild Arms 2. --- src/core/cpu_code_cache.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/cpu_code_cache.cpp b/src/core/cpu_code_cache.cpp index 1ae296213..8966a9e16 100644 --- a/src/core/cpu_code_cache.cpp +++ b/src/core/cpu_code_cache.cpp @@ -36,14 +36,14 @@ using PageProtectionArray = std::array; using BlockInstructionList = std::vector; -// Switch to manual protection if we invalidate more than 4 times within 20 frames. +// Switch to manual protection if we invalidate more than 4 times within 60 frames. // Fall blocks back to interpreter if we recompile more than 3 times within 15 frames. // The interpreter fallback is set before the manual protection switch, so that if it's just a single block // which is constantly getting mutated, we won't hurt the performance of the rest in the page. static constexpr u32 RECOMPILE_COUNT_FOR_INTERPRETER_FALLBACK = 3; static constexpr u32 RECOMPILE_FRAMES_FOR_INTERPRETER_FALLBACK = 15; static constexpr u32 INVALIDATE_COUNT_FOR_MANUAL_PROTECTION = 4; -static constexpr u32 INVALIDATE_FRAMES_FOR_MANUAL_PROTECTION = 20; +static constexpr u32 INVALIDATE_FRAMES_FOR_MANUAL_PROTECTION = 60; static CodeLUT DecodeCodeLUTPointer(u32 slot, CodeLUT ptr); static CodeLUT EncodeCodeLUTPointer(u32 slot, CodeLUT ptr);