452 Commits

Author SHA1 Message Date
TreeHugger Robot
ed6cd24cfa Merge "Add crystal ball support to pm perf tests" 2020-12-15 01:15:54 +00:00
Ming-Shin Lu
b6c4b82ebf Move TaskSnapshot into android.window package
Bug: 166736352
Test: build pass
Test: atest CtsWindowManagerDeviceTests
Change-Id: I7f03524f018ceb64c109fd9d78abeb0ea98b6ea5
2020-12-13 15:28:56 +00:00
Sudheer Shanka
93abe7223c Merge "Update BlobStorePerfTests test config." 2020-12-10 20:27:24 +00:00
Sudheer Shanka
dbda92e701 Update BlobStorePerfTests test config.
As part of bringing up these tests in Cystalball,
use Collector helper library to wait for device to stabilize
before running the test.

Bug: 163826419
Test: atest BlobStorePerfTests
Change-Id: Iad31b9e0a5b1f17f83499984f41e39118d8cc153
2020-12-08 22:45:42 -08:00
Jeff Sharkey
0ab7007631 resolve merge conflicts of 358f0d4fc8c248498cf113c41e043877a14e89a1 to master
Bug: 174932174
Test: I solemnly swear I tested this conflict resolution.
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Change-Id: I9262a08ffc1ccede8e519d0eed90ed2bfcf0232c
2020-12-08 11:01:05 -07:00
Jeff Sharkey
52b9862f87 Improve OWNERS coverage across frameworks/base/.
As general background, OWNERS files expedite code reviews by helping
code authors quickly find relevant reviewers, and they also ensure
that stakeholders are involved in code changes in their areas.

Some teams under frameworks/base/ have been using OWNERS files
successfully for many years, and we're ready to expand them to cover
more areas.  Here's the historical coverage statistics for the last
two years of changes before these new OWNERS changes land:

-- 56% of changes are fully covered by OWNERS
-- 17% of changes are partially covered by OWNERS
-- 25% of changes have no OWNERS coverage

Working closely with team leads, we've now identified clear OWNERS on
a per-package basis, and we're using "include" directives whenever
possible to to simplify future maintenance.  With this extensive
effort, we've now improved our coverage as follows:

-- 98% of changes are fully covered by OWNERS
-- 1% of changes are partially covered by OWNERS
-- 1% of changes have no OWNERS coverage

This specific change is automatically generated by a script that
identifies relevant "include" directives.

Bug: 174932174
Test: manual
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Merged-In: I3480ddf2fe7ba3dfb922b459d4da01fa17a2c813
Change-Id: I3480ddf2fe7ba3dfb922b459d4da01fa17a2c813
2020-12-08 08:36:28 -07:00
Jeff Sharkey
fab0ab3c9c Improve OWNERS coverage across frameworks/base/.
As general background, OWNERS files expedite code reviews by helping
code authors quickly find relevant reviewers, and they also ensure
that stakeholders are involved in code changes in their areas.

Some teams under frameworks/base/ have been using OWNERS files
successfully for many years, and we're ready to expand them to cover
more areas.  Here's the historical coverage statistics for the last
two years of changes before these new OWNERS changes land:

-- 56% of changes are fully covered by OWNERS
-- 17% of changes are partially covered by OWNERS
-- 25% of changes have no OWNERS coverage

Working closely with team leads, we've now identified clear OWNERS on
a per-package basis, and we're using "include" directives whenever
possible to to simplify future maintenance.  With this extensive
effort, we've now improved our coverage as follows:

-- 98% of changes are fully covered by OWNERS
-- 1% of changes are partially covered by OWNERS
-- 1% of changes have no OWNERS coverage

This specific change is automatically generated by a script from
detailed ownership information confirmed by team leads.

Bug: 174932174
Test: manual
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Merged-In: I9789c97c1de8e5d962b48c29c57d82fe83729eba
Change-Id: I9789c97c1de8e5d962b48c29c57d82fe83729eba
2020-12-08 08:36:27 -07:00
Riddle Hsu
700bdd58fd Extract window related perf test base classes
Add WindowPerfTestBase and WindowPerfRunPreconditionBase
into apct-perftests-utils. So window manager and input
method manager can share the same functions.

Bug: 174292015
Test: WmPerfTests ImePerfTests
Change-Id: Ie2818536d6611d1ba5f4b6cd725cd2d4a95e1cac
2020-12-07 19:26:40 +08:00
Patrick Baumann
d73f1e28ab Add crystal ball support to pm perf tests
This change adds the necessary build dependencies and test rules to
support adding the package manager perf test suite to crystal ball.

Bug: 169160667
Test: atest PackageManagerPerfTests
Change-Id: I1335b40737473541f12f5f4c4ef2bb32eea6196b
2020-12-04 12:07:29 -08:00
TreeHugger Robot
a0b6a8dbd8 Merge changes I48be0250,I58634142
* changes:
  Measure IMF latency 5/n
  Measure IMF latency 4/n
2020-12-01 19:10:15 +00:00
Taran Singh
7db4dd9abb Measure IMF latency 5/n
Add Cold IMF startup latency test

Bug: 167947940
Test: atest ImePerfTests#showImeCold

Change-Id: I48be0250c59cb352e3be0558c780294eaae0f7ff
2020-12-01 16:52:48 +00:00
Kohsuke Yatoh
2309375646 Add perf test for Typeface serialization.
Bug: 172891184
Test: atest TypefaceSerializationPerfTest
Change-Id: I3a0c8ba26350d6ca51a93a458e73362ac23c566f
2020-11-20 11:28:04 -08:00
TreeHugger Robot
81a1f37b1c Merge "Consistent handling of modified UTF-8." 2020-11-14 02:29:42 +00:00
Jeff Sharkey
50a99364c6 Consistent handling of modified UTF-8.
A recent set of patches had mismatched handling of UTF-8 vs modified
UTF-8; this change converges all paths towards using modified UTF-8
to match the DataInput/Output API contract.

New tests verify that underlying raw data is compatible between the
upstream and local implementations.

Bug: 171832118
Test: atest FrameworksCoreTests:android.util.CharsetUtilsTest
Test: atest FrameworksCoreTests:android.util.XmlTest
Test: atest FrameworksCoreTests:android.util.BinaryXmlTest
Test: atest FrameworksCoreTests:com.android.internal.util.FastDataTest
Change-Id: I49423edc867839fb6626cd8bd361abe7bc512633
2020-11-13 14:11:41 -07:00
Taran Singh
ae3b92905f Merge "Measure baseline IMF latency (1/n)" 2020-11-12 18:59:22 +00:00
TreeHugger Robot
9c68993941 Merge "Add benchmarks for ViewRootImpl InputStage" 2020-11-12 08:46:45 +00:00
Taran Singh
bf33706655 Measure baseline IMF latency (1/n)
Measure latency caused by IMF for IME operations like show / hide.
This CL uses apct tests for integration with Crystallball to measure
overall latency and breakdown of critical IMF methods.
In this CL we introduce a BaselineIme with minimal UI to measure
user-preceived delays in IME show/hide.
Refer to design doc in bug.

Bug: 167947940
Test: atest ImePerfTests and also refer to README.md
Change-Id: I8efff52fe25952d452aef7f059400c63d1a9fa4a
2020-11-11 18:05:26 +00:00
Jeff Sharkey
af7d02531c Merge changes from topic "nov7"
* changes:
  Custom binary XML wire protocol.
  Progress towards efficient XML serialization.
  More efficient alternatives to ByteBuffer.
  CharsetUtils alternatives that avoid allocations.
2020-11-10 23:35:51 +00:00
Jeff Sharkey
4ccea87969 Custom binary XML wire protocol.
We've identified that XML writing and reading uses roughly 1.5% of
all system_server CPU, and can generate many temporary objects.

Building on the recent TypedXmlSerializer/PullParser interfaces, this
change introduces new BinaryXmlSerializer/PullParser implementations
that store data using a custom binary wire protocol.  Benchmarking of
a typical packages.xml has shown this new binary approach can write
4.3x faster and read 8.5x faster, while using 2.4x less disk space:

    timeWrite_Fast_mean: 27946635
    timeWrite_Binary_mean: 6519341

    timeRead_Fast_mean: 59562531
    timeRead_Binary_mean: 7020185

A major factor in choosing to invest in this new wire protocol is
that it enables the long-tail of over 100 unique XML schemas used
across the OS internals to be transparently upgraded to gain these
benefits with only minimal changes, reducing the risks associated
with rewriting those schemas.

Finally, since the wire protocol is essentially a serialized event
stream, it's trivial to transparently convert this new protocol
into human-readable XML and vice-versa.  The tests in this change
demonstrate this translation working correctly, and future changes
will introduce new shell tools to aid development work.

Bug: 171832118
Test: atest FrameworksCoreTests:android.util.XmlTest
Test: atest FrameworksCoreTests:android.util.BinaryXmlTest
Test: atest CorePerfTests:android.util.XmlPerfTest
Change-Id: Ib9390701f09562dca952b3786622675b9c68a462
2020-11-10 11:58:03 -07:00
Jeff Sharkey
162f86ddce More efficient alternatives to ByteBuffer.
Some upcoming binary XML work needs to efficiently read and write
raw bytes, and we initially started using ByteBuffer.  However, that
design had additional overhead since we were performing bounds checks
twice (once to fill/drain buffers, then again to parse data).  In
addition, the upstream ByteBuffer makes per-byte method invocations
internally, instead of going directly the the buffer.

This change introduces FastDataInput/Output as local implementations
of DataInput/Output which are focused on performance.  They also
handle fill/drain from an underlying Input/OutputStream, and the
included benchmarks show reading 3x faster and writing 2x faster:

    timeRead_Upstream_mean: 5543730
    timeRead_Local_mean: 1698602

    timeWrite_Upstream_mean: 3731119
    timeWrite_Local_mean: 1885983

We also use the new CharsetUtils methods to write UTF-8 values
directly without additional allocations whenever possible.  This
requires using a non-movable buffer to avoid JNI overhead to gain
the 30% benchmarked performance wins.

Bug: 171832118
Test: atest CorePerfTests:com.android.internal.util.FastDataPerfTest
Test: atest FrameworksCoreTests:com.android.internal.util.FastDataTest
Change-Id: If28ee381adb528d03cc9851d78236d985b6ede16
2020-11-10 11:56:06 -07:00
arthurhung
b6eeec5acb Add benchmarks for ViewRootImpl InputStage
Add the benchmark for processing InputEvent in ViewRootImpl.
* the cost of processing KeyEvent
* the cost of processing MotionEvent
* the cost of processing KeyEvent with IME x (handle preIME or not)
* the cost of processing MotionEvent with IME x (handle preIME or not)

Test: atest InputStageBenchmark
Bug: 162193693
Change-Id: I64f6b2e8ec3e841461553dbc6c9f4c0dfdd8ef86
2020-11-11 00:29:51 +08:00
Jeff Sharkey
7a38dcc938 CharsetUtils alternatives that avoid allocations.
Internally String.getBytes() calls libcore.util.CharsetUtils methods
for a handful of common charsets, but that path requires new memory
allocations for every call.

This change introduces alternative versions of those methods which
attempt to encode data directly into an already-allocated memory
region.  If the destination is to small, callers can detect and pivot
back to calling String.getBytes().

The included benchmarks reveal these raw performance improvements,
in addition to the reduced GC load which is harder to measure:

    timeLocal_LargeBuffer[simple]_mean: 424
    timeLocal_SmallBuffer[simple]_mean: 511
    timeUpstream[simple]_mean: 800

    timeLocal_LargeBuffer[complex]_mean: 977
    timeLocal_SmallBuffer[complex]_mean: 1266
    timeUpstream[complex]_mean: 1468

Bug: 171832118
Test: atest CorePerfTests:android.util.CharsetUtilsPerfTest
Test: atest FrameworksCoreTests:android.util.CharsetUtilsTest
Change-Id: Iac1151e7cb8e88bf82339cada64b0936e1a7578b
2020-11-09 17:22:03 -07:00
TreeHugger Robot
85036ff713 Merge "Switch APCT VibratorPerfTest to use Jetpack Benchmark" 2020-11-09 16:39:19 +00:00
Lais Andrade
a3f16a8e24 Switch APCT VibratorPerfTest to use Jetpack Benchmark
Bug: 170370918
Test: atest CorePerfTests:VibratorPerfTest
Change-Id: I79d3877987553f873dc295978440baac299c9062
2020-11-06 19:33:56 +00:00
Jeff Sharkey
88e8d72a75 Double speed of Parcel.writeString().
Previous logic was using GetStringUTFChars() and GetStringCritical(),
which resulted in making a new temporary heap allocation and an extra
memcpy().  The new approach in this CL bypasses those operations by
asking the JNI helpers to copy directly into the Parcel buffer.

This does mean that the contract for writing strings (prefixed with
length) is now duplicated in Parcel.cpp and android_os_Parcel.cpp,
so we leave docs to ensure future maintainers keep them in sync.

Benchmarking shows that this change improves performance by ~36%
for UTF-8 strings and ~52% for UTF-16 strings:

Before:
    timeWriteString8[simple]_mean: 1323
    timeWriteString8[complex]_mean: 2103
    timeWriteString16[simple]_mean: 1427
    timeWriteString16[complex]_mean: 1368

After:
    timeWriteString8[simple]_mean: 846
    timeWriteString8[complex]_mean: 1671
    timeWriteString16[simple]_mean: 685
    timeWriteString16[complex]_mean: 748

Bug: 172562452
Test: atest CorePerfTests:android.os.ParcelStringPerfTest
Change-Id: Ibacce2547ecc7a050b698cee8aa5b4e3bc45956f
2020-11-05 09:22:35 -07:00
TreeHugger Robot
f14def61aa Merge "Add VariableFont perf test" 2020-11-03 06:00:10 +00:00
Seigo Nonaka
ce85f46b72 Add VariableFont perf test
Bug: N/A
Test: atest VariableFontPerfTest
Change-Id: I3cb54ebe0ea5e77c31e5c817378a8fc1514f95b7
2020-10-29 16:50:26 -07:00
Seigo Nonaka
0568983e8b Reduce the number used for perf test
likely 30K char causes OOM during perf test.
Reduced to 3K.

Bug: 168845780
Test: N/A
Change-Id: I32f3c1791ec27f8f83011158a592c2a1d01e16b8
2020-10-29 16:22:36 -07:00
TreeHugger Robot
2774758434 Merge "Add Benchmark for PackageManager.getResourcesForApplication" 2020-10-22 09:57:16 +00:00
Felka Chang
a0bf0ccc74 Add Benchmark for PackageManager.getResourcesForApplication
Add the benchmark for anwsering the performance issue.
* the cost of the createContextAsUser
* the comparsion between *AsUser and createContextAsUser

Test: atest CorePerfTests:android.content.pm.PackageManagerBenchmark
Bug: 171370490
Change-Id: I7da6d4127520c1132c6050472a0c1ba462ab03d3
2020-10-22 16:36:16 +08:00
Treehugger Robot
de9b68eb10 Merge "Change perf-setup.sh to perf-setup in run.sh" am: 5d1eaf9cee am: 2af9f0911e am: d9d95e4dc0 am: 91c44f8ce0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1461289

Change-Id: Id6636d1a6f78a5da4e9b5e52f988a8425d7ee9c0
2020-10-22 06:12:05 +00:00
Tiger Huang
9e2c966d61 Merge "Don't dispatch legacy insets to client" 2020-10-21 15:23:27 +00:00
Tiger Huang
2bf8c796c5 Don't dispatch legacy insets to client
The server won't dispatch the legacy content insets, stable insets, and
visible insets to the client. The insets would be computed from the
insets state by the client.

This CL also fixes the insets scaling issue in compatible mode.

Bug: 149813814
Fix: 169940916
Fix: 165412978
Test: atest WindowAddRemovePerfTest InsetsAnimationControlImplTest
            ActivityRecordTests DisplayPolicyLayoutTests
            InsetsPolicyTest InsetsStateControllerTest
Change-Id: I83570973f587a6abf887752494f750b46e3e484d
2020-10-21 20:20:21 +08:00
Peter Kalauskas
16b27d5064 Merge "Change perf-setup.sh to perf-setup in README.md" 2020-10-20 14:50:00 +00:00
Tiger Huang
e1833c6cfd Merge "Make the requested visibility always up-to-date" 2020-10-17 09:18:03 +00:00
TreeHugger Robot
eac0321ff3 Merge changes from topic "oct16b"
* changes:
  Recommend efficient String operations.
  Simple alternative to String.format().
2020-10-16 22:27:50 +00:00
Jeff Sharkey
af7c5f95cb Simple alternative to String.format().
This purposefully supports only a small handful of substitutions to
improve execution speed.  Benchmarking reveals this optimized
alternative performs 6.5x faster for a typical format string.

Add Preconditions overloads that accept varargs to avoid string
formatting overhead in successful case.

Bug: 170978902
Test: atest FrameworksCoreTests:android.text.TextUtilsTest
Test: ./frameworks/base/libs/hwui/tests/scripts/prep_generic.sh little && atest CorePerfTests:android.text.TextUtilsPerfTest
Change-Id: I3fae4dc95cfc98a61c4a7f07ca0781c4a2ee3be9
2020-10-16 13:44:16 -06:00
Tiger Huang
bf015c77b4 Make the requested visibility always up-to-date
The new logic sends the requested visibility to server even when the
client doesn't have a control. This makes the requested visibility
reliable at the server side.

This CL also changes getRequestedState to getRequestedVisibility in
WindowState, because the frames in getRequestedState are not reliable.

Fix: 161247175
Fix: 166819574
Test: atest DisplayPolicyLayoutTests DisplayPolicyTests InsetsPolicyTest
            InsetsSourceProviderTest InsetsStateControllerTest
            WindowStateTests InsetsAnimationControlImplTest
            InsetsControllerTest WindowAddRemovePerfTest
            ActivityRecordTests
Change-Id: I7d32dacaa1302bab61386f5bd69aaa7dde953ebe
2020-10-16 16:38:08 +08:00
Peter Kalauskas
03e120ea67 Change perf-setup.sh to perf-setup in run.sh
Test: atest-src google/perf/jank/UIBench/UIBench-Lock -v
Bug: 170349152
Change-Id: Ia6fb178adce5272c8efc2633b2f068e310be7fc1
2020-10-14 18:40:55 -07:00
Peter Kalauskas
1f5dd2802b Change perf-setup.sh to perf-setup in README.md
Test: atest-src google/perf/jank/UIBench/UIBench-Lock -v
Bug: 170349152
Change-Id: I391eb8669f3ce1c4c44c26227d25cf3ecc64bbc6
2020-10-14 15:25:14 -07:00
chaviw
4a10b38ad4 Removed separate SurfaceControl for Blast
If Blast was enabled, WindowStateAnimator would create a container layer
and then a blast layer as a child. This caused some issues with
reparentChildren and relative Z, so instead of trying to continously fix
those issues, just use one layer. If blast is enabled, it will create a
single SurfaceControl with type blast. Otherwise, it will create a
BufferQueueLayer.

This means that we have to be careful with setting any properties on
the layer since the blast adapter could also be modifying the layer.
This is in the right direction since we will move all transactions for
the layer to the client, eventually.

Test: YT and Chrome with and without Blast
Change-Id: I43efc37663696ba8e54d341a03531f0048ee6a14
2020-10-13 17:48:57 -07:00
Joanne Chung
2c437a6bc3 Fix and enable the fail Autofill Perf Tests.
1.Fix using the wrong AutofillId to set the dataset.
2.Fix using the old setValue API.
3.Unlock lockscreen before test.
4.Make sure the Settings value is set before the test.

Bug: 169368561
Bug: 162216576
Test: atest AutofillPerfTests
Change-Id: I2abf8db5271e8e1719f91514eadb22bf9b4f8bb5
2020-10-08 21:14:19 +08:00
Louis Chang
d1b79549d2 Renaming Stacks APIs to RootTasks
This CL is aimed to refine the AM/ATM API surface. The other
stack naming internally spread in AM and ATM will be covered
in later CLs.

Also Consolidate #removeStack() with #removeTask().

Bug: 157876448
Test: existing tests

Change-Id: I1254f972dab3bbe66a736a0402eebce9d0fb1496
2020-10-06 08:39:18 +08:00
Riddle Hsu
613ba2d25e Support latency metrics for recents gesture
Accpet the event time from RecentsAnimation#startRecentsActivity.
Also remove unused method of recents animation in activity manager.

Bug: 169221287
Test: Enable statsd log: "adb shell cmd stats print-logs"
      Touch gesture navigation bar.
      adb logcat | grep statsd | grep "(48)"
      The line may contain 0x100000->4[I] 0x110000->20[I]
      that means 4=by recents and 20=latency 20ms.

Change-Id: Ia188a6a3b0dab9edaa0052df3b18508f8cc895d3
2020-10-05 15:56:01 +08:00
Seigo Nonaka
f61ce18e44 Fix canvas crash in CanvasDrawTextTest
Call drawText in begin/end recording section.

Bug: 168846481
Test: atest CanvasDrawTextTest
Change-Id: I512f7a7b3de44236e567f80281a2fd9fbb61be9a
2020-10-02 03:47:28 +00:00
Tiger Huang
b7d379147e Merge "Remove redundant logic about System UI visibility" 2020-09-28 13:30:22 +00:00
Tiger Huang
a9b8fa272c Remove redundant logic about System UI visibility
This CL removes
- mSeq
- System UI flags used to communicate between WMS and System UI
- redundant AIDL methods
- redundant fields and methods
- redundant tests
- PolicyControl

This CL also
- refines the format in DisplayPolicy#dump
- sends a boolean to InputManager to indicate if System UI is in a low
  profile mode instead of sending the legacy system UI visibility

Bug: 149813814
Fix: 169105126
Test: presubmit
Test: dumpsys window displays
Test: See if the layout of ImmersiveModeConfirmation is as expected
Change-Id: I8c8df509355bebc9b560af57d5458614557bcd2f
2020-09-28 02:04:21 +08:00
Jeff Sharkey
3709d3ef00 Merge changes from topic "sep23"
* changes:
  Improve performance of small CursorWindows.
  Benchmarks to measure CursorWindow overheads.
2020-09-25 16:51:59 +00:00
Winson Chiu
6320e514da Merge "Include fonts as non asset file for CorePerfTests" 2020-09-25 05:11:50 +00:00
Jeff Sharkey
7d34c94652 Benchmarks to measure CursorWindow overheads.
We have some ideas on how to improve the efficiency of CursorWindow
transport for smaller data sets, but we want to get some benchmarking
in place to better characterize our upcoming changes.

These tests move a small, medium, and large cursor across process
boundaries, exercising the typical ContentProvider.query() flow.

Bug: 169251528
Test: ./frameworks/base/libs/hwui/tests/scripts/prep_generic.sh little && atest CorePerfTests:android.database.CrossProcessCursorPerfTest
Change-Id: Ia9e6a3195324db93a02d224e8b5108d397e3bb41
2020-09-23 11:57:18 -06:00