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
This commit is contained in:
Fyodor Kupolov
2017-07-21 19:36:50 -07:00
parent 19d8565f10
commit 66c1852cce
3 changed files with 209 additions and 290 deletions

View File

@@ -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);

View File

@@ -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