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

Commit 66c1852c authored by Fyodor Kupolov's avatar Fyodor Kupolov
Browse files

Improve NewDatabasePerformanceTests

They didn't properly report timings. It included setup time.
Also cleaned up code and added CREATE TABLE performance test.

Test: run_newdb_perf_test.sh
Bug: 63942513
Change-Id: I15fcb5fa43f81e8ea39c2e29252527a8f3714398
parent 19d8565f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ public class NewDatabasePerformanceTestSuite extends TestSuite {
        TestSuite suite =
          new TestSuite(NewDatabasePerformanceTestSuite.class.getName());

        suite.addTestSuite(NewDatabasePerformanceTests.CreateTable100.class);
        suite.addTestSuite(NewDatabasePerformanceTests.Insert100.class);
        suite.addTestSuite(NewDatabasePerformanceTests.InsertIndexed100.class);
        suite.addTestSuite(NewDatabasePerformanceTests.Select100.class);
+203 −288

File changed.

Preview size limit exceeded, changes collapsed.

+5 −2
Original line number Diff line number Diff line
@@ -17,8 +17,11 @@ make -j44 FrameworksCoreTests
adb install -r -g ${ANDROID_PRODUCT_OUT}/data/app/FrameworksCoreTests/FrameworksCoreTests.apk
adb logcat -c

echo "Running benchmark 5 times"
for i in {1..5}
# by default run 5 times
RUN_N=${1:-5}
echo "Running benchmark $RUN_N times"

for (( i=0; i<$RUN_N; i++ ))
do
    adb  shell am instrument -e class 'android.database.NewDatabasePerformanceTestSuite' -w 'com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner'
done