summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2024-04-26 01:11:34 +0100
committerNicolas Geoffray <ngeoffray@google.com>2024-04-26 15:33:54 +0000
commitb9198f3b3a9fc22118e1d40888d8423eac448ad1 (patch)
tree31b541e71773f1ac06c30cc14d60a6672aeca206
parent99d99134a573dd4c6e64b098578d01c188bc421b (diff)
downloadart-b9198f3b3a9fc22118e1d40888d8423eac448ad1.tar.gz
Adjust JIT thresholds.
Reduce the default case to avoid JITting too much, and increase the lookup threshold for the UI thread. Reduces jank on compose view scrolling for 4 iterations: - For Go Mokey: - Before: ~1048 frames drawn / ~4.05% janky frames - After: ~1107 frames drawn / ~3.55% janky frames - For Pixel 8 pro: - Before: ~2575 frames drawn / ~0.60% janky frames - After: ~2582 frames drawn / ~0.58% janky frames Bug: 313040662 Change-Id: Ib0a977b933912da53be96a8c53d74a8df0fb0756
-rw-r--r--runtime/interpreter/mterp/nterp.cc5
-rw-r--r--runtime/jit/jit_options.cc2
2 files changed, 4 insertions, 3 deletions
diff --git a/runtime/interpreter/mterp/nterp.cc b/runtime/interpreter/mterp/nterp.cc
index bcc59a4032..d8ce2bcaed 100644
--- a/runtime/interpreter/mterp/nterp.cc
+++ b/runtime/interpreter/mterp/nterp.cc
@@ -118,8 +118,9 @@ void CheckNterpAsmConstants() {
inline void UpdateHotness(ArtMethod* method) REQUIRES_SHARED(Locks::mutator_lock_) {
// The hotness we will add to a method when we perform a
// field/method/class/string lookup.
- constexpr uint16_t kNterpHotnessLookup = 0xff;
- method->UpdateCounter(kNterpHotnessLookup);
+ bool increase_hotness_for_ui = Runtime::Current()->InJankPerceptibleProcessState() &&
+ Thread::Current()->IsJitSensitiveThread();
+ method->UpdateCounter(increase_hotness_for_ui ? 0x6ff : 0xf);
}
template<typename T>
diff --git a/runtime/jit/jit_options.cc b/runtime/jit/jit_options.cc
index 3c31d1dfcd..b68d14e427 100644
--- a/runtime/jit/jit_options.cc
+++ b/runtime/jit/jit_options.cc
@@ -31,7 +31,7 @@ static constexpr uint32_t kJitStressDefaultOptimizeThreshold = kJitDefaultOptimi
static constexpr uint32_t kJitSlowStressDefaultOptimizeThreshold =
kJitStressDefaultOptimizeThreshold / 2;
-static constexpr uint32_t kJitDefaultWarmupThreshold = 0x3fff;
+static constexpr uint32_t kJitDefaultWarmupThreshold = 0xffff;
// Different warm-up threshold constants. These default to the equivalent warmup thresholds divided
// by 2, but can be overridden at the command-line.
static constexpr uint32_t kJitStressDefaultWarmupThreshold = kJitDefaultWarmupThreshold / 2;