167 Commits

Author SHA1 Message Date
Kweku Adams
53de12ef0d Merge "Slight improvements to ArraySet." 2018-11-02 22:28:48 +00:00
Kweku Adams
65b5ee346d Slight improvements to ArraySet.
1. There are cases where valueAt could return null even though the given
index was out of bounds. I've added a check for that in the code.
2. The default implementation of Collection.removeIf() uses the
iterator(). This change avoids that since the iterator is an inefficient
way to access the array contents.

Benchmark tests. Note that these times are in nanoseconds:

Before:

INSTRUMENTATION_STATUS: removeIf_Small_Base_mean=163679
INSTRUMENTATION_STATUS: removeIf_Small_Base_median=158215
INSTRUMENTATION_STATUS: removeIf_Small_Base_min=129564
INSTRUMENTATION_STATUS: removeIf_Small_Base_standardDeviation=24779
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: valueAt_OutOfBounds_Negative_mean=5645195
INSTRUMENTATION_STATUS: valueAt_OutOfBounds_Negative_median=5584964
INSTRUMENTATION_STATUS: valueAt_OutOfBounds_Negative_min=5448560
INSTRUMENTATION_STATUS: valueAt_OutOfBounds_Negative_standardDeviation=206915
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: removeIf_Large_RemoveHalf_mean=1316514
INSTRUMENTATION_STATUS: removeIf_Large_RemoveHalf_median=1282442
INSTRUMENTATION_STATUS: removeIf_Large_RemoveHalf_min=1216533
INSTRUMENTATION_STATUS: removeIf_Large_RemoveHalf_standardDeviation=109087
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: removeIf_Large_Base_mean=571712
INSTRUMENTATION_STATUS: removeIf_Large_Base_median=566500
INSTRUMENTATION_STATUS: removeIf_Large_Base_min=535726
INSTRUMENTATION_STATUS: removeIf_Large_Base_standardDeviation=26374
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: valueAt_OutOfBounds_EdgeCase_mean=946
INSTRUMENTATION_STATUS: valueAt_OutOfBounds_EdgeCase_median=896
INSTRUMENTATION_STATUS: valueAt_OutOfBounds_EdgeCase_min=841
INSTRUMENTATION_STATUS: valueAt_OutOfBounds_EdgeCase_standardDeviation=106
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: removeIf_Large_RemoveAll_mean=2196954
INSTRUMENTATION_STATUS: removeIf_Large_RemoveAll_median=2163910
INSTRUMENTATION_STATUS: removeIf_Large_RemoveAll_min=2136283
INSTRUMENTATION_STATUS: removeIf_Large_RemoveAll_standardDeviation=91149
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: removeIf_Small_RemoveHalf_mean=356644
INSTRUMENTATION_STATUS: removeIf_Small_RemoveHalf_median=350376
INSTRUMENTATION_STATUS: removeIf_Small_RemoveHalf_min=337067
INSTRUMENTATION_STATUS: removeIf_Small_RemoveHalf_standardDeviation=17354
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: removeIf_Large_RemoveNothing_mean=1044645
INSTRUMENTATION_STATUS: removeIf_Large_RemoveNothing_median=1040981
INSTRUMENTATION_STATUS: removeIf_Large_RemoveNothing_min=1010144
INSTRUMENTATION_STATUS: removeIf_Large_RemoveNothing_standardDeviation=35016
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: removeIf_Small_RemoveAll_mean=507561
INSTRUMENTATION_STATUS: removeIf_Small_RemoveAll_median=503419
INSTRUMENTATION_STATUS: removeIf_Small_RemoveAll_min=471564
INSTRUMENTATION_STATUS: removeIf_Small_RemoveAll_standardDeviation=33141
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: removeIf_Small_RemoveNothing_mean=300889
INSTRUMENTATION_STATUS: removeIf_Small_RemoveNothing_median=295486
INSTRUMENTATION_STATUS: removeIf_Small_RemoveNothing_min=282948
INSTRUMENTATION_STATUS: removeIf_Small_RemoveNothing_standardDeviation=19869
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: valueAt_InBounds_mean=644
INSTRUMENTATION_STATUS: valueAt_InBounds_median=584
INSTRUMENTATION_STATUS: valueAt_InBounds_min=528
INSTRUMENTATION_STATUS: valueAt_InBounds_standardDeviation=141
INSTRUMENTATION_STATUS_CODE: -1

After:

INSTRUMENTATION_STATUS: removeIf_Small_Base_mean=143926
INSTRUMENTATION_STATUS: removeIf_Small_Base_median=145985
INSTRUMENTATION_STATUS: removeIf_Small_Base_min=125700
INSTRUMENTATION_STATUS: removeIf_Small_Base_standardDeviation=11112
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: valueAt_OutOfBounds_Negative_mean=5173581
INSTRUMENTATION_STATUS: valueAt_OutOfBounds_Negative_median=5168995
INSTRUMENTATION_STATUS: valueAt_OutOfBounds_Negative_min=5108405
INSTRUMENTATION_STATUS: valueAt_OutOfBounds_Negative_standardDeviation=45739
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: removeIf_Large_RemoveHalf_mean=695812
INSTRUMENTATION_STATUS: removeIf_Large_RemoveHalf_median=690070
INSTRUMENTATION_STATUS: removeIf_Large_RemoveHalf_min=679793
INSTRUMENTATION_STATUS: removeIf_Large_RemoveHalf_standardDeviation=17959
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: removeIf_Large_Base_mean=591815
INSTRUMENTATION_STATUS: removeIf_Large_Base_median=588499
INSTRUMENTATION_STATUS: removeIf_Large_Base_min=573707
INSTRUMENTATION_STATUS: removeIf_Large_Base_standardDeviation=14348
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: valueAt_OutOfBounds_EdgeCase_mean=4010666
INSTRUMENTATION_STATUS: valueAt_OutOfBounds_EdgeCase_median=4017245
INSTRUMENTATION_STATUS: valueAt_OutOfBounds_EdgeCase_min=3970170
INSTRUMENTATION_STATUS: valueAt_OutOfBounds_EdgeCase_standardDeviation=28577
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: removeIf_Large_RemoveAll_mean=734297
INSTRUMENTATION_STATUS: removeIf_Large_RemoveAll_median=732576
INSTRUMENTATION_STATUS: removeIf_Large_RemoveAll_min=720065
INSTRUMENTATION_STATUS: removeIf_Large_RemoveAll_standardDeviation=14906
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: removeIf_Small_RemoveHalf_mean=195026
INSTRUMENTATION_STATUS: removeIf_Small_RemoveHalf_median=194430
INSTRUMENTATION_STATUS: removeIf_Small_RemoveHalf_min=190400
INSTRUMENTATION_STATUS: removeIf_Small_RemoveHalf_standardDeviation=4012
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: removeIf_Large_RemoveNothing_mean=772914
INSTRUMENTATION_STATUS: removeIf_Large_RemoveNothing_median=785834
INSTRUMENTATION_STATUS: removeIf_Large_RemoveNothing_min=737947
INSTRUMENTATION_STATUS: removeIf_Large_RemoveNothing_standardDeviation=23808
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: removeIf_Small_RemoveAll_mean=194325
INSTRUMENTATION_STATUS: removeIf_Small_RemoveAll_median=196492
INSTRUMENTATION_STATUS: removeIf_Small_RemoveAll_min=186998
INSTRUMENTATION_STATUS: removeIf_Small_RemoveAll_standardDeviation=5091
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: removeIf_Small_RemoveNothing_mean=187122
INSTRUMENTATION_STATUS: removeIf_Small_RemoveNothing_median=187292
INSTRUMENTATION_STATUS: removeIf_Small_RemoveNothing_min=182272
INSTRUMENTATION_STATUS: removeIf_Small_RemoveNothing_standardDeviation=4902
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: valueAt_InBounds_mean=918
INSTRUMENTATION_STATUS: valueAt_InBounds_median=919
INSTRUMENTATION_STATUS: valueAt_InBounds_min=801
INSTRUMENTATION_STATUS: valueAt_InBounds_standardDeviation=80
INSTRUMENTATION_STATUS_CODE: -1

Perf test command:
mmma -j ./frameworks/base/apct-tests/perftests/core/;
adb install -r $OUT/data/app/CorePerfTests/CorePerfTests.apk;
adb shell cmd package compile -m speed -f com.android.perftests.core;
adb shell am instrument -w -e class android.util.ArraySetPerfTest com.android.perftests.core/android.support.test.runner.AndroidJUnitRunner

Bug: 118339123
Bug: 117846754
Test: atest android.util.cts.ArraySetTest
and benchmark tests (see above)
Change-Id: Ic4b10fd2bbc7a745ca4e4029ca4829847812fabe
2018-11-01 17:39:35 -07:00
TreeHugger Robot
3875001f59 Merge "Add missing endRecording calls" 2018-10-30 23:57:23 +00:00
John Reck
f401c7e8f5 Add missing endRecording calls
StaticLayoutPerfTest was previously leaking
display lists. RenderNode now notices and yells
about that, exposing this bug

Change-Id: If85c85211a115a4af09edf2a215415fd0d2d0b4b
Fixes: 118650198
Test: this
2018-10-30 10:50:41 -07:00
Misha Wagner
566903ab47 Add class to read per-thread CPU usage from proc filesystem
Reads all thread CPU usage for the current process. This traverses
"/proc/self/task/*/time_in_state" to gather the thread ID and CPU usage
of each child thread. Process name, thread name, and UID are also read from
"/proc" for interpretable data.

Bug: 111534779
Test: Unit test in CpuThreadProcReaderTest

Change-Id: I6c71dde1dfcc9bbb87d95baf0886f9da7a782299
2018-10-30 10:48:27 +00:00
TreeHugger Robot
815aa66d3c Merge "Update some docs & tweak some method names" 2018-10-27 00:24:59 +00:00
John Reck
c7ddcf390f Update some docs & tweak some method names
Test: builds
Change-Id: Id0e5cf6fdb3a391136a1d314498f75e0b954ceeb
2018-10-26 13:57:12 -07:00
Seigo Nonaka
f307adc83e Do not pass context to minikin in case of Canvas.drawText
Canvas.drawText don't use context info, just draw the given slice of
text.

By this change the performance for the long text gets back.

android.text.CanvasDrawTextTest
  drawText_LongText_SmallWindow : 94,526 us -> 11,268 us

Bug: 111638688
Test: atest CanvasDrawTextTest
Change-Id: I69f8cbf4ff361d213f5d041148dbcc41ebd16c84
2018-10-26 10:31:33 -07:00
Olivier Gaillard
8a3e20a76c Update BinderCallsStats perf tests to use a more realistic workload.
Test: this is a test
Change-Id: I6dc7151c3df2a1e488db7d1b703ca29049b2e01a
2018-10-25 16:46:59 +01:00
John Reck
8884cfc13e Merge "Rename & package shuffle" 2018-10-23 20:02:00 +00:00
Olivier Gaillard
e2693cb9ca Perf test to measure various mechanisms to track CPU.
Change-Id: I84cac933c62b03421632a7321a40526d9d3884cf
Test: this is a test
2018-10-08 13:52:46 +01:00
John Reck
32f140aa67 Rename & package shuffle
Rename DisplayListCanvas -> RecordingCanvas
Move RecordingCanvas to android.graphics
Move RenderNode to android.graphics

Bug: 112709971
Test: make & boot
Change-Id: Iddeb6a89f8923ea81a1f37bbee4e9b1db8ede238
2018-10-04 16:18:12 -07:00
Marcin Oczeretko
1003f75bc4 Add perf tests for LooperStats
Test: n/a
Change-Id: I97e290398ca67d3fda0ffeae723c2cb2d0bc10f3
2018-09-06 10:55:03 +01:00
Marcin Oczeretko
c80c81a516 Extract CachedDeviceState from BinderCallsStats
Add a service that tracks the device state properties which are
interesting to System Server telemetry services. Allows the services to
share this code and have consistent state information.

Test: Unit tests and manually tested
Change-Id: Ia5c78c45a55414a0c5c46202db2a37283b50a703
2018-09-06 10:54:55 +01:00
Aurimas Liutikas
64ec5b84b9 Add a simple benchmark for getting view attributes from Theme_Material.
Test: atest CorePerfTests:ResourcesThemePerfTest
Change-Id: I228273c8b83ebfee73c478f72ceec42d3f81a53b
2018-08-23 15:10:27 -07:00
Aurimas Liutikas
3f26befd10 Add a basic ResourcePerfTest.
Moving ResourcesBenchmark.java to the proper android.perftests infrastructure.

Test: ran the benchmark locally.
Change-Id: Ia981274e1e3c167a2a8900498fc40b7a03508a74
2018-08-03 14:37:27 -07:00
Olivier Gaillard
86714d1347 Add support for battery/screen state changes.
Only collect data when the device is charging to be consistent with what
battery stats is doing.

Add a screen interactive dimension to have more context to analysis the
binder calls data.

Test: unit test
Change-Id: Id31c53ae315d905e5d8e67918f64780f34ff5d72
2018-08-01 21:03:59 +01:00
Olivier Gaillard
b80d30d887 Improve the performance tests.
The original tests would only run 5 iterations per test.

Test: unit test
Change-Id: I221129b44e81d4b8dc7151185104af8515a04b29
2018-07-31 19:56:40 +00:00
Olivier Gaillard
eac5c5a189 Add perf tests for binder calls to measure sampling performance.
Test: should I test my test?
Change-Id: Ia96e33966567ffd32c9c50a0d88b82bf4abb21b8
2018-07-31 09:43:28 +00:00
Olivier Gaillard
289ba40237 Adds an Observer interface to observes binder API calls.
This is the first step to move BinderCallsStats implementation to the
server package in order to have an implementation more specific to the
system server (tracking charger on/off).

Removes the volatile keywords in BinderCallsStats.

Also exposes a clean API to StatsCompanionService instead of
BinderCallsStats directly.

Test: unit test
Change-Id: Ied98c555acc8489420104098561b4608346509b5
2018-07-25 21:20:59 +00:00
Olivier Gaillard
2c13c6f37b Binder calls stats - random sampling.
Change the sampling method to be random. The previous mechanism recorded
one call for each key (uid/API name) and every X calls for each key:
- This is biased and will make it to interpret the data from
westworld.  It was especially unfair for apps using many different APIs
since the first call to each API was always recorded.
- It uses more memory since we will keep track of all the long tail

Simplify/unify the way we keep track of sampled calls.

Do not estimate the CPU usage of non-recorded calls
    long samplesCount = cs.callCount / mPeriodicSamplingInterval + 1;
    duration = cs.cpuTimeMicros / samplesCount;
It biases the results, let's use an example with 3 calls: 1ms, 3ms, 5ms
with an sampling interval of 2. With the previous algorithm we would get an
average per call of (1+1+3+2+5)/5=2.4ms. With the new one (1+3+5)/3=3ms.

Test: unit tests
Change-Id: I1dd7eb3c6c631b86a53485bccbfa397882cccc92
2018-07-23 17:39:22 +01:00
Siyamed Sinir
301cda906f Disable hyphen for TextView perf test
Test: atest  CorePerfTests:TextViewSetTextMeasurePerfTest
Bug: 78350836
Change-Id: I83ed7dc29180a010f67e0dc181e1e2e35c25e849
2018-07-22 12:52:15 -07:00
John Reck
d5a9dc06be Expose async & counter publicly
Also add some go-faster to the JNI

Before:
android.os.TracePerfTest:INSTRUMENTATION_STATUS: enabled_mean=13
INSTRUMENTATION_STATUS: enabled_median=13
INSTRUMENTATION_STATUS: enabled_min=13
INSTRUMENTATION_STATUS: enabled_standardDeviation=0
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: beginEndSection_mean=3849
INSTRUMENTATION_STATUS: beginEndSection_median=3850
INSTRUMENTATION_STATUS: beginEndSection_min=3829
INSTRUMENTATION_STATUS: beginEndSection_standardDeviation=14
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: counter_mean=1836
INSTRUMENTATION_STATUS: counter_median=1837
INSTRUMENTATION_STATUS: counter_min=1832
INSTRUMENTATION_STATUS: counter_standardDeviation=2
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: asyncBeginEnd_mean=4992
INSTRUMENTATION_STATUS: asyncBeginEnd_median=4988
INSTRUMENTATION_STATUS: asyncBeginEnd_min=4964
INSTRUMENTATION_STATUS: asyncBeginEnd_standardDeviation=21
INSTRUMENTATION_STATUS_CODE: -1

After:
android.os.TracePerfTest:INSTRUMENTATION_STATUS: enabled_mean=13
INSTRUMENTATION_STATUS: enabled_median=13
INSTRUMENTATION_STATUS: enabled_min=13
INSTRUMENTATION_STATUS: enabled_standardDeviation=0
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: beginEndSection_mean=2974
INSTRUMENTATION_STATUS: beginEndSection_median=2971
INSTRUMENTATION_STATUS: beginEndSection_min=2958
INSTRUMENTATION_STATUS: beginEndSection_standardDeviation=15
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: counter_mean=1737
INSTRUMENTATION_STATUS: counter_median=1739
INSTRUMENTATION_STATUS: counter_min=1732
INSTRUMENTATION_STATUS: counter_standardDeviation=3
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: asyncBeginEnd_mean=3677
INSTRUMENTATION_STATUS: asyncBeginEnd_median=3679
INSTRUMENTATION_STATUS: asyncBeginEnd_min=3663
INSTRUMENTATION_STATUS: asyncBeginEnd_standardDeviation=11
INSTRUMENTATION_STATUS_CODE: -1

Test: builds, benchmarks, verified tracing still works
Bug: 111503982
Change-Id: I71cb026d034bf9b9f97427d10d5ff9ce3d103561
2018-07-17 14:35:01 +00:00
Siyamed Sinir
09206cd86a Merge "Remove equal sign and comma from some text perf tests" 2018-07-11 01:11:23 +00:00
Siyamed Sinir
099554e2ab Remove equal sign and comma from some text perf tests
Test: atest android.text.BoringLayoutCreateDrawPerfTest
Test: android.text.BoringLayoutIsBoringPerfTest
Test: android.text.StaticLayoutCreateDrawPerfTest
Test: android.text.TextViewSetTextMeasurePerfTest
Test: android.text.PaintMeasureDrawPerfTest

Bug: 111319857
Change-Id: Idb9f24cef0c829e0d7d239554463d92fe8093004
2018-07-10 16:26:07 -07:00
Olivier Gaillard
1d7f615eec Add experiment flag to control binder call stats.
For instance, to enabled detailed tracking locally.
adb shell settings put global binder_calls_stats detailed_tracking=true

Also adds the ability to turn off data collection completely and
changing the sampling interval. Uploading data through westworld can
re-use the same flag once implemented.

Test: Unit tested

Change-Id: I808c9902b8124ab643d9b197703d537da040ae3e
2018-07-04 13:36:46 +01:00
TreeHugger Robot
4c51b7c057 Merge "Tweak some RenderNode API surfaces" 2018-06-21 19:05:27 +00:00
Felipe Leme
b251b7f091 Uses autofill callback to throttle performance tests.
Currently the Autofill performance tests work fine, but if we change IAutofillManager
to make oneway binder calls, the tests will crash because of the excessive number of
unfinished binder transactions.

We can fix this issue by using the autofill callbacks that are shown when the UI is shown
or hidden.

Test: mmma -j ./frameworks/base/apct-tests/perftests/autofill/ && \
  adb install -r $OUT/data/app/AutofillPerfTests/AutofillPerfTests.apk && \
  adb shell am instrument -w -e class android.view.autofill.LoginTest \
  com.android.perftests.autofill/android.support.test.runner.AndroidJUnitRunner

Bug: 73536867

Change-Id: I216e67ca97cab059851b0873601e82b368a6abea
2018-06-14 10:26:59 -07:00
John Reck
568b2a64f0 Tweak some RenderNode API surfaces
* no-arg #start()
* remove no-op #destroy method
* fix a Java-imposed quirk that you can't draw a
  currently invalid RenderNode, forcing bottom-up
  recording for no particular reason

Test: builds
Change-Id: I28b41c83b4f7f9ddced843b0d57e9ac510d40ae5
2018-06-04 17:02:02 -07:00
Olivier Gaillard
58b56e3720 Collect a few more binder stats when detailed tracking is enabled.
Test: unit tested

Change-Id: Ibdbbd2b9b60dbc6fa375d60c76f04d42392d6bd3
2018-06-01 21:25:53 +01:00
TreeHugger Robot
15c6708f23 Merge "Introduce perf test for Layout.getOffsetForHorizontal" 2018-05-17 19:37:08 +00:00
Seigo Nonaka
f6f7314544 Introduce perf test for Layout.getOffsetForHorizontal
Bug: 78464361
Test: atest StaticLayoutGetOffsetForHorizontalPerfTest
Change-Id: I2543463daddf6ab174c14e11705de603d0286690
2018-05-17 11:07:40 -07:00
Dan Willemsen
f97d380ca7 Merge "Convert to Soong" am: acbd94d76f am: b1005a8a2a
am: d00c851e55

Change-Id: I889b5d31535d927b3aa9cf5ad6af955ca0678356
2018-05-15 15:52:51 -07:00
Dan Willemsen
d00c851e55 Merge "Convert to Soong" am: acbd94d76f
am: b1005a8a2a

Change-Id: If5cb26e0669f79240d8fee1d40aaa2162d8e611f
2018-05-15 15:06:19 -07:00
Dan Willemsen
4888b1f6f0 Convert to Soong
See build/soong/README.md for more information.

Test: m libframeworks_coretests_jni
Test: m FrameworkCoreTests_install
Test: m libshim_jni
Test: m CtsShimPrivUpgrade
Test: m libfilterfw
Test: m PMTest_Java_dual
Test: m libdefcontainer_jni
Test: m libperftestscore_jni
Test: m libpmtest32 libpmtest64
Test: m libprintspooler_jni
Test: m libsmartcamera_jni
Test: m idmap
Test: m libdrmframework_jni
Test: m libdvr_loader com.google.vr.platform com.google.vr.platform.xml
Test: m libfilterpack_imageproc libfilterpack_base
Test: m libwebviewchromium_loader
Test: m shared_mem_test
Test: m test-touchlag
Change-Id: I868561dd237fa28647896d59049ab9260373ada1
2018-05-14 16:47:02 -07:00
Felipe Leme
660327dda6 Spun off Autofill PERF tests on its own package...
...so bugs on it (like starving the UI Thread) don't impact other tests

Test: mmma -j ./frameworks/base/apct-tests/perftests/autofill/ && \
  adb install -r $OUT/data/app/AutofillPerfTests/AutofillPerfTests.apk && \
  adb shell am instrument -w -e class android.view.autofill.LoginTest \
  com.android.perftests.autofill/android.support.test.runner.AndroidJUnitRunner

Bug: 38345816

Change-Id: I76346f1d1c45790788400fcd9765f6b424d99f4c
2018-05-04 11:42:46 -07:00
Felipe Leme
236c626458 Make Autofill PERF tests more lenient to error.
These tests were based on CTS autofill tests, where correctness is the priority
(for example, there should be no "orphan" onFillRequest() call) and the number
of UI interactions is small.

But that "correctness" model doesn't work well on PERF, because the
onFillRequest() calls are handled in the main thread and the main test loop can
make hundreds of UI calls. For example, if testFocus_autofillUsernameOnly()
doesn't set the ignored id on the password field, each focus on that field would
result in a new onFillRequest(), which is not called right away. As such, the
main loop would finish, but subsequent tests would hang until all those calls
are made.

Test: mmma -j ./frameworks/base/apct-tests/perftests/core/ &&  \
  adb install -r $OUT/data/app/CorePerfTests/CorePerfTests.apk && \
  adb shell am instrument -w -e class android.view.autofill.AutofillPerfTest \
  com.android.perftests.core/android.support.test.runner.AndroidJUnitRunner

Bug: 38345816

Change-Id: I83a311e719966dcf41e86142952075e68d0c64bf
2018-05-03 15:44:58 -07:00
Felipe Leme
984cfdf988 New Autofill PERF test that waits for AutofillCallbacks.
Test: mmma -j ./frameworks/base/apct-tests/perftests/core/ &&  \
  adb install -r $OUT/data/app/CorePerfTests/CorePerfTests.apk && \
  adb shell am instrument -w -e class android.view.autofill.AutofillPerfTest \
  com.android.perftests.core/android.support.test.runner.AndroidJUnitRunner

Bug: 38345816

Change-Id: I60c9061b37c7f1f933740657732825e6edbe665f
2018-05-03 14:16:05 -07:00
Felipe Leme
a052c98fce Removed temporary Autofill PERF tests.
Test: mmma -j ./frameworks/base/apct-tests/perftests/core/ &&  \
  adb install -r $OUT/data/app/CorePerfTests/CorePerfTests.apk && \
  adb shell am instrument -w -e class android.view.autofill.AutofillPerfTest \
  com.android.perftests.core/android.support.test.runner.AndroidJUnitRunner

Bug: 38345816

Change-Id: Ic37b0b2b0cf4a233cdb0104c86990200ed1ea57c
2018-05-03 10:07:19 -07:00
Felipe Leme
bc90715a1a Minor refactorings on Autofill tests:
- Move common code to AbstractAutofillTestCase.
- Copied existing codes to LoginTest, which does not use @Parameters.
- Deprecated AutofillPerfTest (it will be removed once LoginTest has some runs).
- Added some (temporary) no-op tests to help us investigate why some tests are
  missing from the dashboard.

Test: mmma -j ./frameworks/base/apct-tests/perftests/core/ &&  \
  adb install -r $OUT/data/app/CorePerfTests/CorePerfTests.apk && \
  adb shell am instrument -w -e class android.view.autofill.AutofillPerfTest \
  com.android.perftests.core/android.support.test.runner.AndroidJUnitRunner

Bug: 38345816

Change-Id: Iab703205f1e01a1e5413b10c3008aac8efcc5dc2
2018-05-02 16:17:58 -07:00
Felipe Leme
15a074393b Added missing @LargeTest annotation.
Test: mmma -j ./frameworks/base/apct-tests/perftests/core/ &&  \
  adb install -r $OUT/data/app/CorePerfTests/CorePerfTests.apk && \
  adb shell am instrument -w -e class android.view.autofill.AutofillPerfTest \
  com.android.perftests.core/android.support.test.runner.AndroidJUnitRunner

Bug: 38345816wip

Change-Id: I0a6f85683ffb3457fe54a05b4b46b273a3b58cec
2018-05-02 07:30:47 -07:00
Felipe Leme
e4d053886b Uses a custom JUnit rule to preserve value of autofill service settings.
Resetting it is also fine, but it could accidentally "solve" performance issues
on other tests that are affected by the default service set by the OEM.

Test: mmma -j ./frameworks/base/apct-tests/perftests/core/ &&  \
  adb install -r $OUT/data/app/CorePerfTests/CorePerfTests.apk && \
  adb shell am instrument -w -e class android.view.autofill.AutofillPerfTest \
  com.android.perftests.core/android.support.test.runner.AndroidJUnitRunner

Bug: 38345816

Change-Id: Ic196ef3140697e64a5feb39f6b5363387fbf0b14
2018-05-01 13:08:31 -07:00
Felipe Leme
f9dc8d9663 Moar PERF tests for autofill.
These tests render an activity that has 2 autofillable views (username and
password) and keep changint their values, observing what happens in 4 scenarios:

1. No autofill service (baseline)
2. Autofill service returning no datasets.
3. Autofill service returning a dataset with username and password.
4. Autofill service returning a dataset with just username.

Test: mmma -j ./frameworks/base/apct-tests/perftests/core/ &&  \
  adb install -r $OUT/data/app/CorePerfTests/CorePerfTests.apk && \
  adb shell am instrument -w -e class android.view.autofill.AutofillPerfTest \
  com.android.perftests.core/android.support.test.runner.AndroidJUnitRunner

Bug: 38345816

Change-Id: Ifeb8d038f90450ebc96fa7d3ffc7d719a11234ce
2018-05-01 12:54:53 -07:00
Felipe Leme
6378b48f23 Initial PERF tests for autofill.
These tests render an activity that has 2 autofillable views (username and
password) and keep focusing between then, observing what happens in 4 scenarios:

1. No autofill service (baseline)
2. Autofill service returning no datasets.
3. Autofill service returning a dataset with username and password.
4. Autofill service returning a dataset with just username.

Because this change introduced a helper class to run shell commands without
needing the UiAutomator package, it also changed the MultiUserPerfTests to use
such helper.

Test: mmma -j ./frameworks/base/apct-tests/perftests/core/ &&  \
  adb install -r $OUT/data/app/CorePerfTests/CorePerfTests.apk && \
  adb shell am instrument -w -e class android.view.autofill.AutofillPerfTest \
  com.android.perftests.core/android.support.test.runner.AndroidJUnitRunner
Test: mmma -j ./frameworks/base/apct-tests/perftests/multiuser && \
  adb install -r $OUT/data/app/MultiUserPerfTests/MultiUserPerfTests.apk && \
  adb shell am instrument -w -e class android.multiuser.UserLifecycleTests \
  com.android.perftests.multiuser/android.support.test.runner.AndroidJUnitRunner

Bug: 38345816

Change-Id: Ie283dff8dd19c38ea829de9164b23aae2bfeb015
2018-05-01 12:40:33 -07:00
Fyodor Kupolov
b0ad3dd2c6 Merge "Enabled aggregated per-uid stats collection by default" into pi-dev am: 981d61ddf8
am: adb9a96b8e

Change-Id: I76eb5d2c94af5138232142ef603f7da6c088b2fa
2018-04-23 11:09:00 -07:00
Fyodor Kupolov
3f3af617ae Enabled aggregated per-uid stats collection by default
Enabled collection of number of calls per-uid. It has relatively small
overhead. Memory impact is minimal and cpu overhead is also small -
250 ns vs 1500 ns with detailed tracking

Detailed tracking is disabled by default. Controlled by
persist.sys.binder_calls_detailed_tracking

Added commands to reset and enable/disable detailed stats:
dumpsys binder_calls_stats --reset
dumpsys binder_calls_stats --enable-detailed-tracking
dumpsys binder_calls_stats --disable-detailed-tracking

Test: manual
Bug: 75318418
Change-Id: I7c1280c025001b6d2b46e4a37bad841712b6da2f
2018-04-20 16:12:41 -07:00
Seigo Nonaka
c5fe967424 Add memory usage tests for various scripts
Here is an example of test result:

android.text.PrecomputedTextMemoryUsageTest:
  MemoryUsage
    Arabic Hyphenation  : 26,087
    Arabic NoHyphenation: 26,087
    CJK Hyphenation     : 58,515
    CJK NoHyphenation   : 58,515
    Latin Hyphenation   : 38,333
    Latin NoHyphenation : 16,077

Bug: 72461923
Test: manually
Change-Id: If3df2243cf9901178b3fd34882fb20f499fef5ab
2018-04-13 14:11:28 -07:00
Nicolas Geoffray
eff3f44260 Exempt two performance tests from hidden API checks.
Bug: 64382372
Bug: 74963051
Bug: 76162083

Test: m
Change-Id: I50f2c8993cfb8fc7b78dc8c87b2cd8d9ee92d98e
2018-04-06 09:20:33 +01:00
jdesprez
3e09705662 Add the CorePerfTests and MultiUserPerfTests to APCT metrics
Add them to the suite version of APCT metric instrumentation.

Test: atest CorePerfTests
Bug: 77280599
Change-Id: Ia8f0c44fcb9fd21869ed64e54483aa87556a469d
2018-03-29 12:17:50 -07:00
Fyodor Kupolov
163a57d71e Merge "Added BinderCallsStatsService" into pi-dev 2018-03-21 23:02:58 +00:00