Loading core/tests/benchmarks/Android.mk 0 → 100644 +32 −0 Original line number Diff line number Diff line # -*- mode: makefile -*- # Copyright (C) 2015 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. LOCAL_PATH:= $(call my-dir) # build framework base core benchmarks # ============================================================ include $(CLEAR_VARS) LOCAL_MODULE := frameworks-base-core-benchmarks LOCAL_MODULE_TAGS := optional LOCAL_MODULE_CLASS := JAVA_LIBRARIES LOCAL_SRC_FILES := $(call all-java-files-under, src/) LOCAL_NO_STANDARD_LIBRARIES := true LOCAL_JAVA_LIBRARIES := \ caliper-api-target \ framework include $(BUILD_JAVA_LIBRARY) core/tests/benchmarks/src/android/net/NetworkStatsBenchmark.java +3 −5 Original line number Diff line number Diff line Loading @@ -16,10 +16,10 @@ package android.net; import com.google.caliper.BeforeExperiment; import com.google.caliper.Param; import com.google.caliper.SimpleBenchmark; public class NetworkStatsBenchmark extends SimpleBenchmark { public class NetworkStatsBenchmark { private static final String UNDERLYING_IFACE = "wlan0"; private static final String TUN_IFACE = "tun0"; private static final int TUN_UID = 999999999; Loading @@ -28,10 +28,8 @@ public class NetworkStatsBenchmark extends SimpleBenchmark { private int mSize; private NetworkStats mNetworkStats; @Override @BeforeExperiment protected void setUp() throws Exception { super.setUp(); mNetworkStats = new NetworkStats(0, mSize + 2); int uid = 0; NetworkStats.Entry recycle = new NetworkStats.Entry(); Loading core/tests/benchmarks/src/android/net/TrafficStatsBenchmark.java +1 −3 Original line number Diff line number Diff line Loading @@ -16,9 +16,7 @@ package android.net; import com.google.caliper.SimpleBenchmark; public class TrafficStatsBenchmark extends SimpleBenchmark { public class TrafficStatsBenchmark { public void timeGetUidRxBytes(int reps) { for (int i = 0; i < reps; i++) { TrafficStats.getUidRxBytes(android.os.Process.myUid()); Loading core/tests/benchmarks/src/android/os/ParcelArrayBenchmark.java +5 −5 Original line number Diff line number Diff line Loading @@ -16,10 +16,11 @@ package android.os; import com.google.caliper.AfterExperiment; import com.google.caliper.BeforeExperiment; import com.google.caliper.Param; import com.google.caliper.SimpleBenchmark; public class ParcelArrayBenchmark extends SimpleBenchmark { public class ParcelArrayBenchmark { @Param({ "1", "10", "100", "1000" }) private int mSize; Loading @@ -34,7 +35,7 @@ public class ParcelArrayBenchmark extends SimpleBenchmark { private Parcel mIntParcel; private Parcel mLongParcel; @Override @BeforeExperiment protected void setUp() { mWriteParcel = Parcel.obtain(); Loading @@ -50,7 +51,7 @@ public class ParcelArrayBenchmark extends SimpleBenchmark { mLongParcel.writeLongArray(mLongArray); } @Override @AfterExperiment protected void tearDown() { mWriteParcel.recycle(); mWriteParcel = null; Loading Loading @@ -118,5 +119,4 @@ public class ParcelArrayBenchmark extends SimpleBenchmark { mLongParcel.readLongArray(mLongArray); } } } core/tests/benchmarks/src/android/os/ParcelBenchmark.java +5 −4 Original line number Diff line number Diff line Loading @@ -16,18 +16,19 @@ package android.os; import com.google.caliper.SimpleBenchmark; import com.google.caliper.AfterExperiment; import com.google.caliper.BeforeExperiment; public class ParcelBenchmark extends SimpleBenchmark { public class ParcelBenchmark { private Parcel mParcel; @Override @BeforeExperiment protected void setUp() { mParcel = Parcel.obtain(); } @Override @AfterExperiment protected void tearDown() { mParcel.recycle(); mParcel = null; Loading Loading
core/tests/benchmarks/Android.mk 0 → 100644 +32 −0 Original line number Diff line number Diff line # -*- mode: makefile -*- # Copyright (C) 2015 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. LOCAL_PATH:= $(call my-dir) # build framework base core benchmarks # ============================================================ include $(CLEAR_VARS) LOCAL_MODULE := frameworks-base-core-benchmarks LOCAL_MODULE_TAGS := optional LOCAL_MODULE_CLASS := JAVA_LIBRARIES LOCAL_SRC_FILES := $(call all-java-files-under, src/) LOCAL_NO_STANDARD_LIBRARIES := true LOCAL_JAVA_LIBRARIES := \ caliper-api-target \ framework include $(BUILD_JAVA_LIBRARY)
core/tests/benchmarks/src/android/net/NetworkStatsBenchmark.java +3 −5 Original line number Diff line number Diff line Loading @@ -16,10 +16,10 @@ package android.net; import com.google.caliper.BeforeExperiment; import com.google.caliper.Param; import com.google.caliper.SimpleBenchmark; public class NetworkStatsBenchmark extends SimpleBenchmark { public class NetworkStatsBenchmark { private static final String UNDERLYING_IFACE = "wlan0"; private static final String TUN_IFACE = "tun0"; private static final int TUN_UID = 999999999; Loading @@ -28,10 +28,8 @@ public class NetworkStatsBenchmark extends SimpleBenchmark { private int mSize; private NetworkStats mNetworkStats; @Override @BeforeExperiment protected void setUp() throws Exception { super.setUp(); mNetworkStats = new NetworkStats(0, mSize + 2); int uid = 0; NetworkStats.Entry recycle = new NetworkStats.Entry(); Loading
core/tests/benchmarks/src/android/net/TrafficStatsBenchmark.java +1 −3 Original line number Diff line number Diff line Loading @@ -16,9 +16,7 @@ package android.net; import com.google.caliper.SimpleBenchmark; public class TrafficStatsBenchmark extends SimpleBenchmark { public class TrafficStatsBenchmark { public void timeGetUidRxBytes(int reps) { for (int i = 0; i < reps; i++) { TrafficStats.getUidRxBytes(android.os.Process.myUid()); Loading
core/tests/benchmarks/src/android/os/ParcelArrayBenchmark.java +5 −5 Original line number Diff line number Diff line Loading @@ -16,10 +16,11 @@ package android.os; import com.google.caliper.AfterExperiment; import com.google.caliper.BeforeExperiment; import com.google.caliper.Param; import com.google.caliper.SimpleBenchmark; public class ParcelArrayBenchmark extends SimpleBenchmark { public class ParcelArrayBenchmark { @Param({ "1", "10", "100", "1000" }) private int mSize; Loading @@ -34,7 +35,7 @@ public class ParcelArrayBenchmark extends SimpleBenchmark { private Parcel mIntParcel; private Parcel mLongParcel; @Override @BeforeExperiment protected void setUp() { mWriteParcel = Parcel.obtain(); Loading @@ -50,7 +51,7 @@ public class ParcelArrayBenchmark extends SimpleBenchmark { mLongParcel.writeLongArray(mLongArray); } @Override @AfterExperiment protected void tearDown() { mWriteParcel.recycle(); mWriteParcel = null; Loading Loading @@ -118,5 +119,4 @@ public class ParcelArrayBenchmark extends SimpleBenchmark { mLongParcel.readLongArray(mLongArray); } } }
core/tests/benchmarks/src/android/os/ParcelBenchmark.java +5 −4 Original line number Diff line number Diff line Loading @@ -16,18 +16,19 @@ package android.os; import com.google.caliper.SimpleBenchmark; import com.google.caliper.AfterExperiment; import com.google.caliper.BeforeExperiment; public class ParcelBenchmark extends SimpleBenchmark { public class ParcelBenchmark { private Parcel mParcel; @Override @BeforeExperiment protected void setUp() { mParcel = Parcel.obtain(); } @Override @AfterExperiment protected void tearDown() { mParcel.recycle(); mParcel = null; Loading