From 6b25e2373b4f7b150fbb377ef93d5ec3a145420b Mon Sep 17 00:00:00 2001 From: ownedbywuigi Date: Sat, 28 Mar 2026 08:48:09 +0000 Subject: [PATCH] Update JIT options and thresholds for improved performance --- application/basilisk/app/profile/basilisk.js | 9 +++++++++ js/src/jit/IonOptimizationLevels.cpp | 2 +- js/src/jit/IonOptimizationLevels.h | 4 ++-- js/src/jit/JitOptions.cpp | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/application/basilisk/app/profile/basilisk.js b/application/basilisk/app/profile/basilisk.js index 36b5aac6b5..10c57ff75b 100644 --- a/application/basilisk/app/profile/basilisk.js +++ b/application/basilisk/app/profile/basilisk.js @@ -446,6 +446,15 @@ pref("browser.ghostbuster.enabled", true); // misbehave. Should also avoid spurious GCs during ghostbusting. pref("javascript.options.gc_on_memory_pressure", false); +pref("javascript.options.baselinejit.unsafe_eager_compilation", false); +pref("javascript.options.ion.unsafe_eager_compilation", false); +pref("javascript.options.baselinejit.threshold", 4); +pref("javascript.options.ion.threshold", 25); +pref("javascript.options.mem.high_water_mark", 256); +pref("javascript.options.mem.gc_incremental", false); +pref("javascript.options.mem.gc_compacting", false); +pref("javascript.options.mem.gc_incremental_slice_ms", 40); + // This is the pref to control the location bar, change this to true to // force this - this makes the origin of popup windows more obvious to avoid // spoofing. We would rather not do it by default because it affects UE for web diff --git a/js/src/jit/IonOptimizationLevels.cpp b/js/src/jit/IonOptimizationLevels.cpp index f5cfb4ebaf..b3887f01cc 100644 --- a/js/src/jit/IonOptimizationLevels.cpp +++ b/js/src/jit/IonOptimizationLevels.cpp @@ -48,7 +48,7 @@ OptimizationInfo::initNormalOptimizationInfo() smallFunctionMaxInlineDepth_ = 10; compilerWarmUpThreshold_ = CompilerWarmupThreshold; compilerSmallFunctionWarmUpThreshold_ = CompilerSmallFunctionWarmupThreshold; - inliningWarmUpThresholdFactor_ = 0.125; + inliningWarmUpThresholdFactor_ = 0.10; inliningRecompileThresholdFactor_ = 4; } diff --git a/js/src/jit/IonOptimizationLevels.h b/js/src/jit/IonOptimizationLevels.h index 37ed713dc8..37a597e080 100644 --- a/js/src/jit/IonOptimizationLevels.h +++ b/js/src/jit/IonOptimizationLevels.h @@ -128,14 +128,14 @@ class OptimizationInfo uint32_t compilerWarmUpThreshold_; // Default compiler warmup threshold, unless it is overridden. - static const uint32_t CompilerWarmupThreshold = 1000; + static const uint32_t CompilerWarmupThreshold = 700; // How many invocations or loop iterations are needed before small functions // are compiled. uint32_t compilerSmallFunctionWarmUpThreshold_; // Default small function compiler warmup threshold, unless it is overridden. - static const uint32_t CompilerSmallFunctionWarmupThreshold = 100; + static const uint32_t CompilerSmallFunctionWarmupThreshold = 40; // How many invocations or loop iterations are needed before calls // are inlined, as a fraction of compilerWarmUpThreshold. diff --git a/js/src/jit/JitOptions.cpp b/js/src/jit/JitOptions.cpp index a8212fe452..c9b940a137 100644 --- a/js/src/jit/JitOptions.cpp +++ b/js/src/jit/JitOptions.cpp @@ -168,7 +168,7 @@ DefaultJitOptions::DefaultJitOptions() SET_DEFAULT(osrPcMismatchesBeforeRecompile, 6000); // The bytecode length limit for small function. - SET_DEFAULT(smallFunctionMaxBytecodeLength_, 130); + SET_DEFAULT(smallFunctionMaxBytecodeLength_, 200); // An artificial testing limit for the maximum supported offset of // pc-relative jump and call instructions.