Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 42fd7245 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 13545933 from 56a938f3 to 25Q3-release

Change-Id: I9c705977c7ef9a907865c4734386a9708b15e8ff
parents 04188218 56a938f3
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -8,7 +8,6 @@ leetodd@google.com
sadrul@google.com
rwmyers@google.com
nalmalki@google.com
shijianli@google.com
latkin@google.com
djsollen@google.com
hdhabu@google.com
 No newline at end of file
+43 −11
Original line number Diff line number Diff line
@@ -23,6 +23,8 @@ import android.os.HandlerThread;
import android.os.Looper;
import android.os.Message;
import android.os.SystemClock;
import android.perftests.utils.BenchmarkState;
import android.perftests.utils.PerfStatusReporter;
import android.perftests.utils.Stats;
import android.util.Log;

@@ -49,15 +51,21 @@ public class MessageQueuePerfTest {
    private static final int PER_THREAD_MESSAGE_COUNT = 1000;
    private static final int THREAD_COUNT = 8;
    private static final int TOTAL_MESSAGE_COUNT = PER_THREAD_MESSAGE_COUNT * THREAD_COUNT;
    private static final int DEFAULT_MESSAGE_WHAT = 2;

    static Object sLock = new Object();
    private ArrayList<Long> mResults;

    @Before
    public void setUp() { }
    public void setUp() {
        mHandlerThread = new HandlerThread("MessageQueuePerfTest");
        mHandlerThread.start();
    }

    @After
    public void tearDown() { }
    public void tearDown() {
        mHandlerThread.quitSafely();
    }

    class EnqueueThread extends Thread {
        CountDownLatch mStartLatch;
@@ -133,7 +141,7 @@ public class MessageQueuePerfTest {

    private void fillMessagesArray(Message[] messages) {
        for (int i = 0; i < messages.length; i++) {
            messages[i] = mHandlerThread.getThreadHandler().obtainMessage(i);
            messages[i] = mHandlerThread.getThreadHandler().obtainMessage(DEFAULT_MESSAGE_WHAT);
        }
    }

@@ -151,8 +159,6 @@ public class MessageQueuePerfTest {
    public void benchmarkEnqueueAtFrontOfQueue() {
        CountDownLatch threadStartLatch = new CountDownLatch(1);
        CountDownLatch threadEndLatch  = new CountDownLatch(THREAD_COUNT);
        mHandlerThread = new HandlerThread("MessageQueuePerfTest");
        mHandlerThread.start();
        Message[] messages = new Message[TOTAL_MESSAGE_COUNT];
        fillMessagesArray(messages);

@@ -168,8 +174,6 @@ public class MessageQueuePerfTest {

        startTestAndWaitOnThreads(threadStartLatch, threadEndLatch);

        mHandlerThread.quitSafely();

        reportPerf("enqueueAtFront", THREAD_COUNT, PER_THREAD_MESSAGE_COUNT);
    }

@@ -189,8 +193,6 @@ public class MessageQueuePerfTest {
    public void benchmarkEnqueueDelayed() {
        CountDownLatch threadStartLatch = new CountDownLatch(1);
        CountDownLatch threadEndLatch  = new CountDownLatch(THREAD_COUNT);
        mHandlerThread = new HandlerThread("MessageQueuePerfTest");
        mHandlerThread.start();
        Message[] messages = new Message[TOTAL_MESSAGE_COUNT];
        fillMessagesArray(messages);

@@ -206,8 +208,38 @@ public class MessageQueuePerfTest {

        startTestAndWaitOnThreads(threadStartLatch, threadEndLatch);

        mHandlerThread.quitSafely();

        reportPerf("enqueueDelayed", THREAD_COUNT, PER_THREAD_MESSAGE_COUNT);
    }

    @Test
    public void benchmarkSingleThreadedEnqueueAndRemove() throws InterruptedException {
        final CountDownLatch threadEndLatch  = new CountDownLatch(1);
        final TestHandler handler = new TestHandler(mHandlerThread.getLooper());

        Runnable runTest = new Runnable() {
            @Override
            public void run() {
                // Can't make this an @Rule otherwise the multi threaded tests that don't use
                // PerfStatusReporter will throw the error:
                // "java.lang.IllegalStateException: The benchmark hasn't finished"
                final PerfStatusReporter perfStatusReporter = new PerfStatusReporter();
                final BenchmarkState state = perfStatusReporter.getBenchmarkState();

                while (state.keepRunning()) {
                    Message m = handler.obtainMessage(DEFAULT_MESSAGE_WHAT);
                    handler.sendMessageDelayed(m, 10_000);
                    handler.removeMessages(DEFAULT_MESSAGE_WHAT);
                }

                state.sendFullStatusReport(InstrumentationRegistry.getInstrumentation(),
                        "singleThreadedEnqueueAndRemove");

                threadEndLatch.countDown();
            }
        };

        handler.post(runTest);

        threadEndLatch.await();
    }
}
+11 −0
Original line number Diff line number Diff line
@@ -22,6 +22,9 @@ HSPLandroid/graphics/Color;->luminance()F

# For now, compile all methods in MessageQueue to avoid performance cliffs for
# flagged/evolving hot code paths. See: b/338098106
# TODO(shayba): clean up redundant entries after the generated profile is updated
# to include all hot MessageQueue methods, and the inner classes are profiled
# as well.
HSPLandroid/os/MessageQueue;->*
HSPLandroid/os/MessageQueue$FileDescriptorRecord;->*
HSPLandroid/os/MessageQueue$IdleHandler;->*
@@ -46,6 +49,14 @@ HSPLandroid/os/MessageQueue$StackNodeType;->*
HSPLandroid/os/MessageQueue$StateNode;->*
HSPLandroid/os/MessageQueue$TimedParkStateNode;->*

# Concurrent MessageQueue uses ConcurrentSkipListMap.
# See: b/415954362
# TODO(shayba): clean up redundant entries after ag/33686358 is merged.
HSPLjava/util/concurrent/ConcurrentSkipListMap;->*
HSPLjava/util/concurrent/ConcurrentSkipListMap$KeyIterator;->*
HSPLjava/util/concurrent/ConcurrentSkipListMap$KeySet;->*
HSPLjava/util/concurrent/ConcurrentSkipListSet;->*

# For now, compile all methods in PerfettoTrace and PerfettoTrackEventExtra.
# Similar to the existing Trace APIs, these new APIs can impact the performance
# of many subsystems including MessageQueue. This also keeps benchmark
+1 −0
Original line number Diff line number Diff line
@@ -16663,6 +16663,7 @@ java.util.concurrent.ConcurrentMap
java.util.concurrent.ConcurrentNavigableMap
java.util.concurrent.ConcurrentSkipListMap$Index
java.util.concurrent.ConcurrentSkipListMap$Iter
java.util.concurrent.ConcurrentSkipListMap$KeyIterator
java.util.concurrent.ConcurrentSkipListMap$KeySet
java.util.concurrent.ConcurrentSkipListMap$Node
java.util.concurrent.ConcurrentSkipListMap$ValueIterator
+1 −0
Original line number Diff line number Diff line
@@ -56407,6 +56407,7 @@ package android.view.accessibility {
    method @FlaggedApi("com.android.graphics.hwui.flags.high_contrast_text_small_text_rect") public void addHighContrastTextStateChangeListener(@NonNull java.util.concurrent.Executor, @NonNull android.view.accessibility.AccessibilityManager.HighContrastTextStateChangeListener);
    method public boolean addTouchExplorationStateChangeListener(@NonNull android.view.accessibility.AccessibilityManager.TouchExplorationStateChangeListener);
    method public void addTouchExplorationStateChangeListener(@NonNull android.view.accessibility.AccessibilityManager.TouchExplorationStateChangeListener, @Nullable android.os.Handler);
    method @FlaggedApi("android.view.accessibility.enable_trusted_accessibility_service_api") public boolean enableTrustedAccessibilityService(@NonNull android.content.ComponentName);
    method @ColorInt public int getAccessibilityFocusColor();
    method public int getAccessibilityFocusStrokeWidth();
    method @Deprecated public java.util.List<android.content.pm.ServiceInfo> getAccessibilityServiceList();
Loading