In the future, we think the TextClassifier is going to run in an
external process. This CL moves the getLocalTextClassifier() API so
that we don't have to guarantee this to apps.
OEMs implementing TextClassifierServices however will want access to
this API so this CL effectively moves the the API from where apps
typically look for a TC (we prefer apps to call getTextClassifier()
instead) to where TCS implementations are most likely to be accessing
such APIs. The method is also renamed appropriately to what it will be
long term (i.e. the default TC implementation rather than as the local
TC).
Bug: 123681286
Test: atest core/tests/coretests/src/android/view/textclassifier
Test: atest cts/tests/tests/view/src/android/view/textclassifier/cts
Test: adb shell am instrument -w -e class android.textclassifier.TextClassifierPerfTest com.android.perftests.core/androidx.test.runner.AndroidJUnitRunner
Change-Id: I685e2b5263ffddbe301256fc2ed0d6254c3357ed
Reason:
We are more interested in the performance of the textclassifier in
AOSP, rather than AiAi
Test: adb shell am instrument -w -e class android.textclassifier.TextClassifierPerfTest com.android.perftests.core/androidx.test.runner.AndroidJUnitRunner
Change-Id: I00ccc1c4fb5c5469e029d2f70474ddbab65a5732
Settings include:
- Number of buckets
- UID predicate for which threads to collect data for
Test: to test UID selection: `atest KernelCpuThreadReaderTest`
Test: to test settings application: `adb shell cmd settings put ...` and
manual inspection of `pull-source`
Bug: 123562450
Change-Id: I9d97dfc1c120fcf1b04dadb6ce24863afeff053c
This is the framework used by other system component like autofill.
We will use this to answer system health question.
We can also monitor the metric in this dashboard once it is submitted.
https://blackbox.googleplex.com/#/custom/fw_other
Result in pixel2 eng build (unit: nano second)
(We will have more accurate result in the dashboard, we are advised not to run perf test
in eng build)
android.textclassifier.TextClassifierPerfTest:INSTRUMENTATION_STATUS: detectLanguage[size=0]_mean=15010771
INSTRUMENTATION_STATUS: detectLanguage[size=0]_median=15203514
INSTRUMENTATION_STATUS: detectLanguage[size=0]_min=10497747
INSTRUMENTATION_STATUS: detectLanguage[size=0]_standardDeviation=3061947
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: suggestConversationActions[size=0]_mean=39863316
INSTRUMENTATION_STATUS: suggestConversationActions[size=0]_median=41535711
INSTRUMENTATION_STATUS: suggestConversationActions[size=0]_min=35979326
INSTRUMENTATION_STATUS: suggestConversationActions[size=0]_standardDeviation=3297779
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: detectLanguage[size=10]_mean=14711781
INSTRUMENTATION_STATUS: detectLanguage[size=10]_median=13608035
INSTRUMENTATION_STATUS: detectLanguage[size=10]_min=12184472
INSTRUMENTATION_STATUS: detectLanguage[size=10]_standardDeviation=3144018
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: suggestConversationActions[size=10]_mean=43076381
INSTRUMENTATION_STATUS: suggestConversationActions[size=10]_median=43618067
INSTRUMENTATION_STATUS: suggestConversationActions[size=10]_min=38747603
INSTRUMENTATION_STATUS: suggestConversationActions[size=10]_standardDeviation=3502977
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: detectLanguage[size=100]_mean=20646733
INSTRUMENTATION_STATUS: detectLanguage[size=100]_median=20766674
INSTRUMENTATION_STATUS: detectLanguage[size=100]_min=19184218
INSTRUMENTATION_STATUS: detectLanguage[size=100]_standardDeviation=892559
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: suggestConversationActions[size=100]_mean=42126088
INSTRUMENTATION_STATUS: suggestConversationActions[size=100]_median=43709436
INSTRUMENTATION_STATUS: suggestConversationActions[size=100]_min=36636031
INSTRUMENTATION_STATUS: suggestConversationActions[size=100]_standardDeviation=4863678
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: detectLanguage[size=1,000]_mean=21721753
INSTRUMENTATION_STATUS: detectLanguage[size=1,000]_median=22690096
INSTRUMENTATION_STATUS: detectLanguage[size=1,000]_min=16252464
INSTRUMENTATION_STATUS: detectLanguage[size=1,000]_standardDeviation=3445673
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: suggestConversationActions[size=1,000]_mean=45968389
INSTRUMENTATION_STATUS: suggestConversationActions[size=1,000]_median=47465009
INSTRUMENTATION_STATUS: suggestConversationActions[size=1,000]_min=39389483
INSTRUMENTATION_STATUS: suggestConversationActions[size=1,000]_standardDeviation=3820288
INSTRUMENTATION_STATUS_CODE: -1
Test: Run commands below
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.textclassifier.TextClassifierPerfTest com.android.perftests.core/android.support.test.runner.AndroidJUnitRunner
adb shell cmd package compile -m speed -f com.android.perftests.core;
Change-Id: Ia2c746f48ed018269a230422a695caca05844a12
StaticLayoutPerfTest was previously leaking
display lists. RenderNode now notices and yells
about that, exposing this bug
Change-Id: If85c85211a115a4af09edf2a215415fd0d2d0b4b
Fixes: 118650198
Test: this
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
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
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
Moving ResourcesBenchmark.java to the proper android.perftests infrastructure.
Test: ran the benchmark locally.
Change-Id: Ia981274e1e3c167a2a8900498fc40b7a03508a74
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
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
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