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

Commit cafac86b authored by Mark Fasheh's avatar Mark Fasheh
Browse files

Update boot image profile for MessageQueue

We see drastically different performance depending on what
MessageQueue is in use. Mark the whole class for AOT compilation
so we can do proper A/B comparisons between MessageQueue
implementations.

Flag: EXEMPT resource only update
Test: compile
Bug: 338098106
Change-Id: I10c60486d3cc88193bb7f3bba830cccf02212892
parent 342ed5f4
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -19,3 +19,7 @@
# methods are latency sensitive is difficult. For example, this method is executed
# in the system server, not on the UI thread of an app.
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
HSPLandroid/os/MessageQueue;->*
+7 −0
Original line number Diff line number Diff line
@@ -29,6 +29,8 @@ import android.util.proto.ProtoOutputStream;

import com.android.internal.annotations.GuardedBy;

import dalvik.annotation.optimization.NeverCompile;

import java.io.FileDescriptor;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -1331,6 +1333,7 @@ public final class MessageQueue {
                mMatchAllFutureMessages, true);
    }

    @NeverCompile
    private void printPriorityQueueNodes() {
        Iterator<MessageNode> iterator = mPriorityQueue.iterator();

@@ -1342,6 +1345,7 @@ public final class MessageQueue {
        }
    }

    @NeverCompile
    private int dumpPriorityQueue(ConcurrentSkipListSet<MessageNode> queue, Printer pw,
            String prefix, Handler h, int n) {
        int count = 0;
@@ -1357,6 +1361,7 @@ public final class MessageQueue {
        return count;
    }

    @NeverCompile
    void dump(Printer pw, String prefix, Handler h) {
        long now = SystemClock.uptimeMillis();
        int n = 0;
@@ -1387,6 +1392,7 @@ public final class MessageQueue {
                + ", quitting=" + (boolean) sQuitting.getVolatile(this) + ")");
    }

    @NeverCompile
    private int dumpPriorityQueue(ConcurrentSkipListSet<MessageNode> queue,
            ProtoOutputStream proto) {
        int count = 0;
@@ -1399,6 +1405,7 @@ public final class MessageQueue {
        return count;
    }

    @NeverCompile
    void dumpDebug(ProtoOutputStream proto, long fieldId) {
        final long messageQueueToken = proto.start(fieldId);

+4 −0
Original line number Diff line number Diff line
@@ -28,6 +28,8 @@ import android.util.Printer;
import android.util.SparseArray;
import android.util.proto.ProtoOutputStream;

import dalvik.annotation.optimization.NeverCompile;

import java.io.FileDescriptor;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -1106,6 +1108,7 @@ public final class MessageQueue {
        }
    }

    @NeverCompile
    void dump(Printer pw, String prefix, Handler h) {
        synchronized (this) {
            pw.println(prefix + "(MessageQueue is using Legacy implementation)");
@@ -1122,6 +1125,7 @@ public final class MessageQueue {
        }
    }

    @NeverCompile
    void dumpDebug(ProtoOutputStream proto, long fieldId) {
        final long messageQueueToken = proto.start(fieldId);
        synchronized (this) {
+7 −0
Original line number Diff line number Diff line
@@ -30,6 +30,8 @@ import android.util.proto.ProtoOutputStream;

import com.android.internal.annotations.GuardedBy;

import dalvik.annotation.optimization.NeverCompile;

import java.io.FileDescriptor;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -294,6 +296,7 @@ public final class MessageQueue {
        * Keep this for manual debugging. It's easier to pepper the code with this function
        * than MessageQueue.dump()
        */
        @NeverCompile
        void print() {
            Log.v(TAG, "heap num elem: " + mNumElements + " mHeap.length " + mHeap.length);
            for (int i = 0; i < mNumElements; i++) {
@@ -1209,6 +1212,7 @@ public final class MessageQueue {
                sMatchAllFutureMessages, true);
    }

    @NeverCompile
    int dumpPriorityQueue(Printer pw, String prefix, Handler h, MessageHeap priorityQueue) {
        int n = 0;
        long now = SystemClock.uptimeMillis();
@@ -1222,6 +1226,7 @@ public final class MessageQueue {
        return n;
    }

    @NeverCompile
    void dumpPriorityQueue(ProtoOutputStream proto, MessageHeap priorityQueue) {
        for (int i = 0; i < priorityQueue.numElements(); i++) {
            Message m = priorityQueue.getMessageAt(i);
@@ -1229,6 +1234,7 @@ public final class MessageQueue {
        }
    }

    @NeverCompile
    void dump(Printer pw, String prefix, Handler h) {
        synchronized (this) {
            pw.println(prefix + "(MessageQueue is using Locked implementation)");
@@ -1240,6 +1246,7 @@ public final class MessageQueue {
        }
    }

    @NeverCompile
    void dumpDebug(ProtoOutputStream proto, long fieldId) {
        final long messageQueueToken = proto.start(fieldId);
        synchronized (this) {
+7 −0
Original line number Diff line number Diff line
@@ -29,6 +29,8 @@ import android.util.proto.ProtoOutputStream;

import com.android.internal.annotations.GuardedBy;

import dalvik.annotation.optimization.NeverCompile;

import java.io.FileDescriptor;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -1249,6 +1251,7 @@ public final class MessageQueue {
                mMatchAllFutureMessages, true);
    }

    @NeverCompile
    private void printPriorityQueueNodes() {
        Iterator<MessageNode> iterator = mPriorityQueue.iterator();

@@ -1260,6 +1263,7 @@ public final class MessageQueue {
        }
    }

    @NeverCompile
    private int dumpPriorityQueue(PriorityQueue<MessageNode> queue, Printer pw, String prefix,
            Handler h, int n) {
        int count = 0;
@@ -1275,6 +1279,7 @@ public final class MessageQueue {
        return count;
    }

    @NeverCompile
    void dump(Printer pw, String prefix, Handler h) {
        long now = SystemClock.uptimeMillis();
        int n = 0;
@@ -1307,6 +1312,7 @@ public final class MessageQueue {
                + ", quitting=" + (boolean) sQuitting.getVolatile(this) + ")");
    }

    @NeverCompile
    private int dumpPriorityQueue(PriorityQueue<MessageNode> queue, ProtoOutputStream proto) {
        int count = 0;

@@ -1318,6 +1324,7 @@ public final class MessageQueue {
        return count;
    }

    @NeverCompile
    void dumpDebug(ProtoOutputStream proto, long fieldId) {
        final long messageQueueToken = proto.start(fieldId);