Increase the hotness lookup threshold.
Looking up method/field/string/class from nterp has a big cost, so
adjust the treshold accordingly.
Reduces jank on compose view scrolling for 20 seconds:
- For Go Mokey:
- Before: ~300 frames drawn / ~30% janky frames
- After: ~400 frames drawn / ~22% janky frames
- For Pixel 8 pro:
- Before: ~2300 frames drawn / ~3% janky frames
- After: ~2400 frames drawn / ~1% janky frames
Test: test.py
Bug: 313040662
Change-Id: Icf9c2a85f0a7b7633dddd3a28d44068111e01e35
diff --git a/runtime/interpreter/mterp/nterp.cc b/runtime/interpreter/mterp/nterp.cc
index ddd5912..668289a 100644
--- a/runtime/interpreter/mterp/nterp.cc
+++ b/runtime/interpreter/mterp/nterp.cc
@@ -118,7 +118,7 @@
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 = 0xf;
+ constexpr uint16_t kNterpHotnessLookup = 0xff;
method->UpdateCounter(kNterpHotnessLookup);
}