192 Commits

Author SHA1 Message Date
Seigo Nonaka
f2829deea4 StaticLayoutPerfTest: Use fixed seed in each test case
Bug: None
Test: run StaticLayoutPerfTest
Change-Id: I49610b8098d67097569091e18d87eafb9911049b
2018-01-18 15:17:09 -08:00
TreeHugger Robot
881a432d08 Merge "Compute hyphenated word pieces in MeasuredText" 2018-01-18 20:32:54 +00:00
Seigo Nonaka
87b1547c92 Compute hyphenated word pieces in MeasuredText
Bug: 67504091
Test: bit CtsTextTestCases:*
Change-Id: Id1ff5abbf6d433a2d8baad364133fca98d1fe450
2018-01-18 18:30:02 +00:00
TreeHugger Robot
ee0ec3093c Merge "Add performance test for Debug.getPss()" 2018-01-18 01:48:27 +00:00
Arthur Eubanks
d131348d09 Add performance test for Debug.getPss()
Test: m CorePerfTests
Test: adb install CorePerfTests.apk
Test: adb shell am instrument -w -e class android.os.PssPerfTest \
com.android.perftests.core/android.support.test.runner.AndroidJUnitRunner

Change-Id: Ia8cacb86c14b9956c9d526195d90848c678da6a6
2018-01-17 14:28:06 -08:00
Seigo Nonaka
b01e18c3ee Merge "Rename PremeasuredText to MeasuredText" 2018-01-16 00:47:52 +00:00
TreeHugger Robot
eb0a68b29c Merge "Add Permission performance tests" 2018-01-12 23:48:41 +00:00
Arthur Eubanks
263d674d59 Add performance test for BroadcastReceiver
This is intended to be the first of multiple performance tests around
ActivityManager.

This also refactors some of the existing performance utils so that a
BenchmarkState which accepts the elapsed time rather than measures it
can be added (ManualBenchmarkState).

This test measures the current time, sends a Broadcast, the target APK
receives it, measures the current time, and sends its measured time
back to the test APK.

Test: m ActivityManagerPerfTestsTestApp ActivityManagerPerfTests
Test: adb install $OUT/data/app/ActivityManagerPerfTestsTestApp/ActivityManagerPerfTestsTestApp.apk
Test: adb install $OUT/data/app/ActivityManagerPerfTests/ActivityManagerPerfTests.apk
Test: adb shell am instrument -w -e class \
com.android.frameworks.perftests.am.tests.BroadcastPerfTest \
com.android.frameworks.perftests.amtests/android.support.test.runner.AndroidJUnitRunner

Bug: 67460485

Change-Id: Ib1606ff60c6a845088bde5bd1a33294765b88b36
2018-01-12 09:54:13 -08:00
Seigo Nonaka
9d3bd08eba Rename PremeasuredText to MeasuredText
There is already MeasuredText, so renamed existing MeasuredText to
MeasuredParagraph, then renamed PremeasuredText to MeasuredText.

Bug: 67504091
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: bit CtsTextTestCases:*
Change-Id: Ie20bea9501b18fabb36f64d388a7851c4643d4c3
2018-01-11 11:33:32 -08:00
Arthur Eubanks
34ccf9fcc3 Add Permission performance tests
Test: m CorePerfTests
Test: adb install CorePerfTests.apk
Test: adb shell am instrument -w -e class android.os.PermissionTest \
com.android.perftests.core/android.support.test.runner.AndroidJUnitRunner

Change-Id: Iad7b6c1d110c9188c51712925a4d9ffa7d46120e
2018-01-10 13:54:59 -08:00
Seigo Nonaka
fbe63bddd6 Introduce PremeasuredText
By measuring the character widths beforehand, we can save at least 40%
of the StaticLayout construction time which typically happens on UI
thread.
Also verified this doesn't cause performance regression for not
premeasured text.

Raw performance score (Not premeasured -> premeasured, median, N=100)

No Style,   Greedy, Hyphenation OFF:  7,812,975 ->    503,245 (-93.6%)
No Style, Balanced, Hyphenation OFF:  7,843,254 ->    396,892 (-95.0%)

No Style,   Greedy, Hyphenation ON : 19,134,214 -> 11,658,928 (-39.1%)
No Style, Balanced, Hyphenation ON : 19,348,062 -> 11,634,942 (-39.9%)

Styled,     Greedy, Hyphenation OFF: 14,353,673 ->    572,840 (-96.0%)

Raw performance score (w/o patch -> w/ patch, median, N=100):

No Style,   Greedy, Hyphenation OFF:  7,732,894 ->  7,812,975 (+1.04%)
No Style, Balanced, Hyphenation OFF:  7,884,510 ->  7,843,254 (-0.52%)

No Style,   Greedy, Hyphenation ON : 18,986,958 -> 19,134,214 (+0.78%)
No Style, Balanced, Hyphenation ON : 19,232,791 -> 19,348,062 (+0.60%)

Styled,     Greedy, Hyphenation OFF: 14,319,690 -> 14,353,673 (+0.24%)

Bug: 67504091
Test: bit CtsTextTestCases:*
Test: bit CtsGraphicsTestCases:*
Test: bit CtsWidgetTestCases:*
Test: FrameworksCoreTests:android.text.MeasuredTextTest
Change-Id: I0b46f04b42cc012606a9c722eca0d51147a0dcc7
2017-12-11 18:55:12 -08:00
Paul Duffin
b866307f99 Stop statically including legacy-android-test
Statically including legacy-android-test leads to duplicate classes
which causes build time problems (with Proguard) and runtime problems on
older SDK versions. This change:
* Stops statically including legacy-android-test.
* Adds compile time dependencies on andoid.test.base, android.test.mock
  and android.test.runner where necessary.
* Adds <uses-library android:name="android.test.runner"/> to any
  affected package to ensure that the classes that were included by
  legacy-android-test are still available at runtime. That also adds a
  dependency on android.test.base and android.test.mock.

The following change descriptions were generated automatically and so
may be a little repetitive. They are provided to give the reviewer
enough information to check the comments match what has actually been
changed and check the reasoning behind the changes.

* apct-tests/perftests/core/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CorePerfTests results
    in duplicate classes which leads to build time and compile time
    issues.

    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    CorePerfTests's source depends on its classes and because of these
    changes they are no longer present on the compilation path.

* core/tests/ConnectivityManagerTest/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    ConnectivityManagerTest's source depends on its classes and because
    of these changes they are no longer present on the compilation
    path.

    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in ConnectivityManagerTest
    results in duplicate classes which leads to build time and compile
    time issues.

* core/tests/bandwidthtests/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    BandwidthTests's source depends on its classes and because of these
    changes they are no longer present on the compilation path.

    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in BandwidthTests results
    in duplicate classes which leads to build time and compile time
    issues.

* core/tests/bluetoothtests/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    BluetoothTests's source depends on its classes and because of these
    changes they are no longer present on the compilation path.

    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in BluetoothTests results
    in duplicate classes which leads to build time and compile time
    issues.

* core/tests/hosttests/test-apps/DownloadManagerTestApp/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in DownloadManagerTestApp
    results in duplicate classes which leads to build time and compile
    time issues.

    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    DownloadManagerTestApp's source depends on its classes and because
    of these changes they are no longer present on the compilation
    path.

* core/tests/hosttests/test-apps/ExternalSharedPerms/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    ExternalSharedPermsTestApp results in duplicate classes which leads
    to build time and compile time issues.

* core/tests/hosttests/test-apps/ExternalSharedPermsBT/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    ExternalSharedPermsBTTestApp results in duplicate classes which
    leads to build time and compile time issues.

* core/tests/hosttests/test-apps/ExternalSharedPermsDiffKey/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    ExternalSharedPermsDiffKeyTestApp results in duplicate classes
    which leads to build time and compile time issues.

* core/tests/hosttests/test-apps/ExternalSharedPermsFL/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    ExternalSharedPermsFLTestApp results in duplicate classes which
    leads to build time and compile time issues.

* core/tests/notificationtests/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    NotificationStressTests's source depends on its classes and because
    of these changes they are no longer present on the compilation
    path.

    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in NotificationStressTests
    results in duplicate classes which leads to build time and compile
    time issues.

* keystore/tests/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in KeystoreTests results
    in duplicate classes which leads to build time and compile time
    issues.

* media/mca/tests/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    CameraEffectsTests's source depends on its classes and because of
    these changes they are no longer present on the compilation path.

    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CameraEffectsTests
    results in duplicate classes which leads to build time and compile
    time issues.

* media/tests/MediaFrameworkTest/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    mediaframeworktest's source depends on its classes and because of
    these changes they are no longer present on the compilation path.

    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in mediaframeworktest
    results in duplicate classes which leads to build time and compile
    time issues.

* nfc-extras/tests/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in NfcExtrasTests results
    in duplicate classes which leads to build time and compile time
    issues.

* packages/CarrierDefaultApp/tests/unit/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    CarrierDefaultAppUnitTests's source depends on its classes and
    because of these changes they are no longer present on the
    compilation path.

    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    CarrierDefaultAppUnitTests results in duplicate classes which leads
    to build time and compile time issues.

* packages/ExtServices/tests/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    ExtServicesUnitTests's source depends on its classes and because of
    these changes they are no longer present on the compilation path.

    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in ExtServicesUnitTests
    results in duplicate classes which leads to build time and compile
    time issues.

* packages/MtpDocumentsProvider/tests/Android.mk
    Added 'android.test.base' and 'android.test.mock' to
    LOCAL_JAVA_LIBRARIES because MtpDocumentsProviderTests's source
    depends on their classes and because of these changes they are no
    longer present on the compilation path.

    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    MtpDocumentsProviderTests results in duplicate classes which leads
    to build time and compile time issues.

* packages/SettingsLib/tests/integ/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    SettingsLibTests's source depends on its classes and because of
    these changes they are no longer present on the compilation path.

    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in SettingsLibTests
    results in duplicate classes which leads to build time and compile
    time issues.

* packages/SettingsProvider/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in SettingsProvider
    results in duplicate classes which leads to build time and compile
    time issues.

* packages/SettingsProvider/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to SettingsProvider
    at runtime.

* packages/Shell/tests/Android.mk
    Added 'android.test.base' and 'android.test.mock' to
    LOCAL_JAVA_LIBRARIES because ShellTests's source depends on their
    classes and because of these changes they are no longer present on
    the compilation path.

    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in ShellTests results in
    duplicate classes which leads to build time and compile time
    issues.

* packages/SystemUI/shared/tests/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in SystemUISharedLibTests
    results in duplicate classes which leads to build time and compile
    time issues.

* packages/SystemUI/tests/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in SystemUITests results
    in duplicate classes which leads to build time and compile time
    issues.

    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    SystemUITests's source depends on its classes and because of these
    changes they are no longer present on the compilation path.

* packages/WAPPushManager/tests/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    WAPPushManagerTests's source depends on its classes and because of
    these changes they are no longer present on the compilation path.

    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in WAPPushManagerTests
    results in duplicate classes which leads to build time and compile
    time issues.

* sax/tests/saxtests/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    FrameworksSaxTests's source depends on its classes and because of
    these changes they are no longer present on the compilation path.

    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in FrameworksSaxTests
    results in duplicate classes which leads to build time and compile
    time issues.

* tests/BrowserPowerTest/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    BrowserPowerTests's source depends on its classes and because of
    these changes they are no longer present on the compilation path.

    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in BrowserPowerTests
    results in duplicate classes which leads to build time and compile
    time issues.

* tests/CanvasCompare/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    CanvasCompare's source depends on its classes and because of these
    changes they are no longer present on the compilation path.

    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CanvasCompare results
    in duplicate classes which leads to build time and compile time
    issues.

* tests/CoreTests/android/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    CoreTests's source depends on its classes and because of these
    changes they are no longer present on the compilation path.

    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in CoreTests results in
    duplicate classes which leads to build time and compile time
    issues.

* tests/DataIdleTest/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    DataIdleTest's source depends on its classes and because of these
    changes they are no longer present on the compilation path.

    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in DataIdleTest results in
    duplicate classes which leads to build time and compile time
    issues.

* tests/FrameworkPerf/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    FrameworkPerf's source depends on its classes and because of these
    changes they are no longer present on the compilation path.

    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in FrameworkPerf results
    in duplicate classes which leads to build time and compile time
    issues.

* tests/HierarchyViewerTest/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    HierarchyViewerTest's source depends on its classes and because of
    these changes they are no longer present on the compilation path.

    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in HierarchyViewerTest
    results in duplicate classes which leads to build time and compile
    time issues.

* tests/ImfTest/tests/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    ImfTestTests's source depends on its classes and because of these
    changes they are no longer present on the compilation path.

    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in ImfTestTests results in
    duplicate classes which leads to build time and compile time
    issues.

* tests/Internal/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in InternalTests results
    in duplicate classes which leads to build time and compile time
    issues.

* tests/MemoryUsage/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    MemoryUsage's source depends on its classes and because of these
    changes they are no longer present on the compilation path.

    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in MemoryUsage results in
    duplicate classes which leads to build time and compile time
    issues.

* tests/NetworkSecurityConfigTest/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    NetworkSecurityConfigTests's source depends on its classes and
    because of these changes they are no longer present on the
    compilation path.

    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    NetworkSecurityConfigTests results in duplicate classes which leads
    to build time and compile time issues.

* tests/SoundTriggerTests/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in SoundTriggerTests
    results in duplicate classes which leads to build time and compile
    time issues.

    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    SoundTriggerTests's source depends on its classes and because of
    these changes they are no longer present on the compilation path.

* tests/SurfaceComposition/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in SurfaceComposition
    results in duplicate classes which leads to build time and compile
    time issues.

    Added 'android.test.runner.stubs' to LOCAL_JAVA_LIBRARIES because
    SurfaceComposition's source depends on its classes and because of
    these changes they are no longer present on the compilation path.

* tests/TtsTests/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in TtsTests results in
    duplicate classes which leads to build time and compile time
    issues.

    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    TtsTests's source depends on its classes and because of these
    changes they are no longer present on the compilation path.

* tests/WindowAnimationJank/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in WindowAnimationJank
    results in duplicate classes which leads to build time and compile
    time issues.

* tests/permission/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    FrameworkPermissionTests's source depends on its classes and
    because of these changes they are no longer present on the
    compilation path.

    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    FrameworkPermissionTests results in duplicate classes which leads
    to build time and compile time issues.

* tests/testables/tests/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in TestablesTests results
    in duplicate classes which leads to build time and compile time
    issues.

    Added 'android.test.base' and 'android.test.mock' to
    LOCAL_JAVA_LIBRARIES because TestablesTests's source depends on
    their classes and because of these changes they are no longer
    present on the compilation path.

Bug: 30188076
Test: make checkbuild
Change-Id: Iacfc939c97415314366ed61c5f3b7aa1a40f0ec9
2017-12-08 00:07:17 +00:00
Seigo Nonaka
f0206bd9eb Add more test configuration to StaticLayoutPerfTest
This CL adds more perf test case for StaticLayout.

The "testCreate" and "testCreateRandom" is renamed to
"testCreate_FixedText_NoStyle_Greedy_NoHyphenation" and
"testCreate_RandomText_NoStyled_Greedy_NoHyphenation".

The test configuration is now constructed with underscores.

- FixedText/RandomText
  The text contents to be used for performing StaticLayout generation.
  FixedText means using the same text.
  RandmText means generating random text.
  This configuration is mainly seeing how LayoutCache performs well.

- NoStyle/Styled
  The text styles to be used for performing StaticLayout generation.
  NoStyle means using not styled text. (CharBuffer is used).
  Styled means using randomly styled text.

- Greedy/Balanced
  The line breaking strategy to be used performing StaticLayout generation.
  Greedy means using Greedy algorithm.
  Balanced means that the line length is balanced.

- Hyphenation/NoHyphenation
  The word can be hyphenated for performing StaticLayout generation.
  Hyphenation means enable hyphenation.
  NoHyphenation means disable hyphenation.

This CL doesn't add all combination since some configuration doesn't
affect others. For example, Styled/NoStyled and
Greedy/Balanced/Hyphenation/NoHyphenation are independent.

Bug: N/A
Test: N/A
Change-Id: Ibd05a6c40b314e2db6a04459a9bfb32334d6e0c7
2017-12-05 06:10:40 +00:00
Greg Hackmann
ceb5dd0faf PaintMeasureTextTest: only pause/resume not_cached benchmarks
Pausing and resuming the benchmark timer isn't needed unless we plan to
flush the text layout cache.  The cached benchmark runs are so fast on
high-end devices, the overhead of these extra calls can be significant
compared to the actual code being measured.

Test: run PaintMeasureTextTest on sailfish

Bug: 69634871
Change-Id: If8246154e50451d82ac96e026036aa4a42eaed8d
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2017-11-30 08:34:21 -08:00
Fyodor Kupolov
a81b8c0932 Provide remote stack trace information
The stack is truncated up to 5 lines at parcel time. When unparceling,
a separate RemoteException will be created and set as a cause of the
exception being thrown.

Performance results(in nanoseconds):
timeWriteExceptionWithStackTraceParceling  4168
timeWriteException                         2201
timeReadException                         15878
timeReadExceptionWithStackTraceParceling  23805

Test: manual + ParcelPerfTest
Bug: 36561158
Change-Id: I18b64a6c39c24ab067115874ddb5bd71f556a601
2017-11-14 14:31:32 -08:00
TreeHugger Robot
4d15475cf3 Merge "AccountManager#getAccounts bench" 2017-10-27 00:59:19 +00:00
John Reck
bfd0498b86 AccountManager#getAccounts bench
Test: this
Bug: 68150110

Change-Id: Ic90817d6f1f0ed705b1894a2aac302ce302672a6
2017-10-23 13:11:11 -07:00
Kurt Nelson
714abd365c Perftests for StrictMode
Add perf tests for:

* Disk read thread policy violation
* URI permission VM policy violation
* Disk read across binder thread policy violation

lunch walleye-userdebug

timeThreadViolation_mean=293735
timeThreadViolation_median=290845
timeThreadViolation_min=285718
timeThreadViolation_standardDeviation=8368

timeCrossBinderThreadViolationNoStrictMode_mean=1327809
timeCrossBinderThreadViolationNoStrictMode_median=1317313
timeCrossBinderThreadViolationNoStrictMode_min=1260868
timeCrossBinderThreadViolationNoStrictMode_standardDeviation=58085

timeCrossBinderThreadViolation_mean=2754359
timeCrossBinderThreadViolation_median=3170103
timeCrossBinderThreadViolation_min=1773987
timeCrossBinderThreadViolation_standardDeviation=704586

timeVmViolationNoStrictMode_mean=10764979
timeVmViolationNoStrictMode_median=9762317
timeVmViolationNoStrictMode_min=5187496
timeVmViolationNoStrictMode_standardDeviation=4099275

timeVmViolation_mean=20003781
timeVmViolation_median=21730129
timeVmViolation_min=14321899
timeVmViolation_standardDeviation=3837213

timeThreadViolationNoStrictMode_mean=237276
timeThreadViolationNoStrictMode_median=241457
timeThreadViolationNoStrictMode_min=227193
timeThreadViolationNoStrictMode_standardDeviation=8892

Bug: 65966451
Test: adb shell am instrument -w -e class android.os.StrictModeTest \
    com.android.perftests.core/android.support.test.runner.AndroidJUnitRunner

Change-Id: I97773e1060e21cf78649454973426985b33d3350
2017-10-20 22:01:46 +00:00
Fyodor Kupolov
026d82e07c Added perf test to measure bytes written
Bug: 64262688
Test: SQLiteDatabaseIoPerfTest
Change-Id: I00e14254cec0849cd054d91b5ae70684ce753902
2017-10-17 17:38:57 -07:00
Fyodor Kupolov
d41e4f0c34 Added APCT test for SQLiteDatabase
It measures typical CRUD operations and loading rows into the Cursor

Test: SQLiteDatabasePerfTest
Bug: 64262688
Change-Id: Id25f8fcea57a19a8c963c5458591262f4cabbb84
2017-10-16 13:10:23 -07:00
Siyamed Sinir
1f84ea9f2d Update perf test labels for dashboard
Perf dashboard cannot match test labels with empty space. This CL
removes -<empty space>chars- from the test labels.

Test: None
Bug: 67112217
Change-Id: Id4f3a3b8340df2b691e5fe3ae4b10ddeae384b0a
2017-10-10 14:37:51 -07:00
Siyamed Sinir
f8ef7ac694 Merge changes from topic "text_perf_sep_2017"
* changes:
  Reduce Text layout performance test combinations
  Performance test for text layout/draw
2017-10-09 20:50:53 +00:00
Fyodor Kupolov
3de2b2e14e Wait for broadcast queue to become idle between test runs
Test: bit MultiUserPerfTests:android.multiuser.UserLifecycleTests
Bug: 64165549
Change-Id: I593885d737fab1ef717a166f6219129809ccfd99
2017-10-05 14:26:00 -07:00
Siyamed Sinir
d0a5206dd8 Reduce Text layout performance test combinations
We have measured and identified important combinations for layout
performance tests. In order to reduce the number of tests logged, this
CL removed some of the parameterized tests configurations.

Test: bit CorePerfTests:android.text.PaintMeasureDrawPerfTest
Test: bit CorePerfTests:android.text.BoringLayoutIsBoringPerfTest
Test: bit CorePerfTests:android.text.BoringLayoutCreateDrawPerfTest
Test: bit CorePerfTests:android.text.StaticLayoutCreateDrawPerfTest
Test: bit CorePerfTests:android.text.TextViewSetTextMeasurePerfTest

Bug: 67112217
Change-Id: I92a08f679a185595a519465450881a814f2b4feb
2017-10-02 16:55:04 -07:00
Siyamed Sinir
af479b8c97 Performance test for text layout/draw
Test: bit CorePerfTests:android.text.PaintMeasureDrawPerfTest
Test: bit CorePerfTests:android.text.BoringLayoutIsBoringPerfTest
Test: bit CorePerfTests:android.text.BoringLayoutCreateDrawPerfTest
Test: bit CorePerfTests:android.text.StaticLayoutCreateDrawPerfTest
Test: bit CorePerfTests:android.text.TextViewSetTextMeasurePerfTest

Bug: 67112217
Change-Id: Ibb55431fb82a4fccba39c2bc250c83560dda0259
2017-10-02 15:15:11 -07:00
Siyamed Sinir
5f6eda577d Refactor imports for text performance tests
Test: None
Change-Id: I6c60cd2d3c634750db12ab17236867f0660fd828
2017-09-26 22:57:31 -07:00
Seigo Nonaka
749e57e5c3 Implement LineBreaker callback and fix indent repeating.
The last indent should be repeated, so we need to pass an int array
instead of null even if the indent offset is out of array length.

Bug: 65024629
Test: bit CtsTextTestCases:android.text.cts.StaticLayoutTest
Test: bit CtsTextTestCases:android.text.cts.DynamicLayoutTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Bug: 65024629

Change-Id: Ic1274d797db27ae1921135a27bab55e475369710
2017-08-30 14:57:50 -07:00
John Reck
938e884a1f Avoid setting high contrast in every view draw
Test: high contrast text still works
Change-Id: I6674d1aca8dddf7eb9725a5346aed12ef1dbc195
2017-08-24 16:15:58 -07:00
Roozbeh Pournader
737dfead64 Support extra linespacing based on fallback fonts
* Increase the ascent and descent of individual lines in StaticLayout
  as needed, if any fallback fonts that end up getting used call for
  it. For backward compatibility, this is hidden behind a builder
  flag.
* Document in Paint.java that the returned parameters are only for
  the default font, and a layout may need more space based on
  fallbacks used.

Also update for changes in minikin API:

* MinikinFont now requires a method for getting vertical extents
  (ascent, descent, and line gap).
* minikin API now allows asking for vertical extents of laid out
  text.
* minikin API's LineBreaker now returns ascents and descents for each
  line.

Finally, added performances test for creating a StaticLayout.
Follwing are the numbers on a marlin with a stable clock before and
after this CL.

For fixed text almost always hitting the cache:
Before: mean=260684 median=260188 min=258532 standardDeviation=1897
After:  mean=262432 median=261509 min=260429 standardDeviation=2185

For random text almost never hitting the cache:
Before: mean=5971827 median=5991126 min=5886871 standardDeviation=83724
After:  mean=6337093 median=6317010 min=6311222 standardDeviation=40213

Bug: 28963299
Bug: 29063863
Bug: 32057121
Bug: 37756858
Test: bit FrameworksCoreTests:android.text.
Test: bit CtsTextTestCases:*
Change-Id: I482a98ff8f472e8bab4f0ba9d1d7b368858038ff
2017-08-17 12:10:31 -07:00
Seigo Nonaka
917748ef50 Improve TextView.onMeasure() for multiline text.
Previously, measures all paragraph for deciding view width.
However, in case AT_MOST measurment, we can stop calculating measure if
the measured paragraph already exceeds the upper limit.

Bug: 64389125
Test: bit CtsWidgetTestCases:*
Test: CorePerfTest. Here is a result before and after this patch.

Before:
INSTRUMENTATION_STATUS: measure_AtMost_median=50332114
INSTRUMENTATION_STATUS: measure_Exactly_median=28276317
INSTRUMENTATION_STATUS: measure_Unspecified_median=50193036

After:
INSTRUMENTATION_STATUS: measure_AtMost_median=28475187
INSTRUMENTATION_STATUS: measure_Exactly_median=26944710
INSTRUMENTATION_STATUS: measure_Unspecified_median=50880088

Change-Id: I2a39eb39817a8f845c4fa2e174a905a2d057096e
2017-08-04 17:21:06 +00:00
Sudheer Shanka
2d0278b09f Update user perf tests to report only mean.
Test: bit MultiUserPerfTests:android.multiuser.UserLifecycleTests
Change-Id: Ib70123217c54b469844ce65ec52b7e7ed5b5998d
2017-07-12 18:15:02 -07:00
Sudheer Shanka
a319f8b35d Update test names in UserLifecycleTest.
Test: bit MultiUserPerfTests:android.multiuser.UserLifecycleTest
Change-Id: I49908f8da023a419b79124cc2f366f6d5e8a066d
2017-07-11 15:28:48 -07:00
Sudheer Shanka
d49d82b4c1 Merge "Fix UserLifecycleTest." 2017-06-29 23:27:47 +00:00
Sudheer Shanka
5f76e1fa85 Fix UserLifecycleTest.
Bug: 62058707
Test: bit MultiUserPerfTests:android.multiuser.UserLifecycleTest
Change-Id: I8667190f001f609040a977a19aa956d7064ccc18
2017-06-29 12:08:48 -07:00
Makoto Onuki
b148b6c3c8 Parcel: Use @CriticalNative when possible.
- Change some methods from FastNative to CritcialNative
- Change nativeGetBlobAshmemSize to CritcalNative

- ParcelPerfTest.java (CorePerfTests)
bullhead-userdebug + prep_buller.sh, mean(ns), changed methods only
-- After
timeGetDataCapacity_mean    166 +39.16%
timeGetDataPosition_mean    169 +53.25%
timeReadByte_mean           296 +39.86%
timeReadLong_mean           284 +61.97%
timeSetDataPosition_mean    173 +34.10%
timeGetDataSize_mean        173 +37.57%
timeReadInt_mean            284 +57.04%

-- Before
timeGetDataCapacity_mean    231
timeGetDataPosition_mean    259
timeReadByte_mean           414
timeReadLong_mean           460
timeSetDataPosition_mean    232
timeGetDataSize_mean        238
timeReadInt_mean            446

Bug: 62135986
Test: bit CtsOsTestCases:android.os.cts.ParcelTest
Change-Id: I8c7ede25c87017ef2c7a49beaa3ac781c08ea365
2017-06-28 09:03:09 -07:00
Chris Craik
716cf42552 Add CursorWindow perf tests
Test: 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.database.CursorWindowPerfTest com.android.perftests.core/android.support.test.runner.AndroidJUnitRunner

Change-Id: Ie4b128ad8c6bca08be7bf2b4fb0f9db3c7aa3288
2017-06-16 11:41:21 -07:00
TreeHugger Robot
1062e533a9 Merge "Increase the timeout and add stopping managed profile test" 2017-06-01 11:44:17 +00:00
Tony Mak
ec7c6963bd Increase the timeout and add stopping managed profile test
The dashbaord suggests that multiple tests are always capped at the same
value due to the timeout. To collect the actual metric, set a larger
timeout value, 10s for now.

Also, added a test to stop managed profile user. However, the test is
still finishing surprisingly fast because of the empty broadcast queue.


Bug: 62096041

Test: adb shell am instrument -e class android.multiuser.UserLifecycleTest -w com.android.perftests.multiuser/android.support.test.runner.AndroidJUnitRunner

Change-Id: Ia52db17525d9eb960c9a8c860cdb52c0f487e5f1
2017-05-31 16:06:02 +01:00
Seigo Nonaka
c07169eddc Merge "Introduce early exit path for non resource path." into oc-dev am: 01d5b3d2af
am: 99c587a9b1

Change-Id: I7e09b074f7fff0f273ca2be896439bae0c0c92d0
2017-05-18 23:54:24 +00:00
Seigo Nonaka
2ea169a2ec Introduce early exit path for non resource path.
Developer can specify android:fontFamily with three ways, pre-defined
font family name, e.g. "sans-serif", path to the font file in resource
directory, e.g. "res/fonts/Roboto-Regular.ttf", or path to the XML font
family file, e.g. "res/fonts/Roboto.xml".

Resources.getFont treats font files and XML files but pre-defined family
name is handled by TextView. Thus, we can early exit if the passed value
is not likely resource path.

This improves the inflation performance.
The score without this patch:
gfx-avg-frame-time-50: 6.9
gfx-avg-frame-time-90: 9.4
gfx-avg-frame-time-95: 10.4
gfx-avg-frame-time-99: 16.7

The score with this patch:
gfx-avg-frame-time-50: 7.0
gfx-avg-frame-time-90: 8.9
gfx-avg-frame-time-95: 9.7
gfx-avg-frame-time-99: 16.5

Measured on bullhead-userdebug.

The APCT perf test improves from
String FontFamily: 200,086 -> 132,561
File FontFamily  : 199,256 -> 161,843
XML FontFamily   : 203,681 -> 158,553

Measured on angler-userdebug.

Bug: 38232467
Test: UiBenchmark
Change-Id: Ia601ae7207ae8c60848c9efdbb9396267a57257c
2017-05-16 10:14:56 -07:00
John Reck
f3903e9f15 Fix regression in getSharedPreferences performance
Only do access checks if there's a cache miss. If there's
a cache hit then those checks have necessarily already
passed once so we don't need to repeatedly do them
on every access.

Before:
timeCachedGetSharedPreferences_mean=126084

After:
timeCachedGetSharedPreferences_mean=362

Test: ran perf test
Change-Id: I51f0186f8e66c05ea0e5a457930377d1460dea17
2017-05-12 17:21:15 -07:00
Colin Cross
52f6ba9a9d Move SystemPerfTest out of java.* namespace
dx doesn't like classes in the java.* namespace unless it is compiling
a core library.  Move SystemPerfTest to
android.perftests.SystemPerfTest.

Test: builds
Change-Id: I24951d2c9a71d8bb873763d1ccd2f1a67f2be64e
2017-02-28 10:44:04 -08:00
Andrei Stingaceanu
ab18567419 AutoSize TextView (part 11) - fix final APIs
* public attr "autoSizeText" becomes "autoSizeTextType"
  (inlined with all other methods and naming)
* documentation for autoSizetextType "uniform" re-worked:
  "The TextView scales text size both horizontally and
  vertically to fit  within the container"
* converted comments into Javadoc for
  TextView#AUTO_SIZE_TEXT_TYPE_NONE and
  TextView#AUTO_SIZE_TEXT_TYPE_UNIFORM
* better documented attr "autoSizePresetSizes" to specify
  it is a resource array of dimensions
* various small fixes in comments

Bug: 35755149
Bug: 35763485
Bug: 35764658
Bug: 32221168
Test: run cts-dev -m CtsWidgetTestCases -t \
      android.widget.cts.TextViewTest

Change-Id: I36afd399e005521b6e85922aa9e1e4418bb960e1
2017-02-27 15:17:46 +00:00
Andrei Stingaceanu
fbfead24c2 AutoSize TextView (part 9) - sanitize APIs naming
This CL is no-op (cosmetics only)
* renames autoSizeText type "xy" to "uniform"
* renames attribute "autoSizeStepSizeSet" to "autoSizePresetSizes"
* renames "AUTO_SIZE_TEXT_TYPE_XY" to "AUTO_SIZE_TEXT_TYPE_UNIFORM"
* renames public TextView#getAutoSizeTextPresetSizes() to public
  TextView#getAutoSizeTextAvailableSizes() because this method can
  return either preset sizes or computed sizes (via min/max/step)

Bug: 34923754
Bug: 32221168
Test: associated test renames in the same topic
Change-Id: Ifacccf21ca014b6c0a07322fa02b7859ee53e387
2017-02-09 15:30:02 +00:00
Paul Duffin
1d0244a846 Prepare for removal of legacy-test from default targets
In preparation for removing junit classes from the Android API
the legacy-test target will be removed from the
TARGET_DEFAULT_JAVA_LIBRARIES. This change adds explicit
dependencies on junit and/or legacy-android-test to ensure that
modules will compile properly once it is removed.

Bug: 30188076
Test: make checkbuild
Change-Id: If507b641624a2933e722f61e815890fcdf442265
2017-01-20 09:00:33 +00:00
Chris Craik
fc29424a3c CriticalNative for RenderNode and DisplayListCanvas
Bug: 33460152
Test:  adb shell am instrument -w -e class android.view.ViewShowHidePerfTest com.android.perftests.core/android.support.test.runner.AndroidJUnitRunner

- Also FastNative for setDisplayList, simplifying upcall into field setter.

- Also removes depth sweep parameter for ViewShowHideTests for now, they're not
providing much extra info.

Together with Outline/Path CL, about 25% faster visibility toggles

960MHz Bullhead Before (prior to Outline/Path CL):

$ adb shell am instrument -w -e class android.view.ViewShowHidePerfTest com.android.perftests.core/android.support.test.runner.AndroidJUnitRunner | grep min
INSTRUMENTATION_STATUS: add[Factory:NestedLinearLayoutTree,depth:6]_min=743505
INSTRUMENTATION_STATUS: goneToVisible[Factory:NestedLinearLayoutTree,depth:6]_min=332420
INSTRUMENTATION_STATUS: invisibleToVisible[Factory:NestedLinearLayoutTree,depth:6]_min=354154
INSTRUMENTATION_STATUS: recordAfterAdd[Factory:NestedLinearLayoutTree,depth:6]_min=1106095
INSTRUMENTATION_STATUS: remove[Factory:NestedLinearLayoutTree,depth:6]_min=1261290
INSTRUMENTATION_STATUS: visibleToGone[Factory:NestedLinearLayoutTree,depth:6]_min=356153
INSTRUMENTATION_STATUS: visibleToInvisible[Factory:NestedLinearLayoutTree,depth:6]_min=362149

After (this CL + Outline/Path CL):

$ adb shell am instrument -w -e class android.view.ViewShowHidePerfTest com.android.perftests.core/android.support.test.runner.AndroidJUnitRunner | grep min
INSTRUMENTATION_STATUS: add[Factory:NestedLinearLayoutTree,depth:6]_min=636061
INSTRUMENTATION_STATUS: goneToVisible[Factory:NestedLinearLayoutTree,depth:6]_min=267481
INSTRUMENTATION_STATUS: invisibleToVisible[Factory:NestedLinearLayoutTree,depth:6]_min=289433
INSTRUMENTATION_STATUS: recordAfterAdd[Factory:NestedLinearLayoutTree,depth:6]_min=976827
INSTRUMENTATION_STATUS: remove[Factory:NestedLinearLayoutTree,depth:6]_min=1207286
INSTRUMENTATION_STATUS: visibleToGone[Factory:NestedLinearLayoutTree,depth:6]_min=286148
INSTRUMENTATION_STATUS: visibleToInvisible[Factory:NestedLinearLayoutTree,depth:6]_min=292834

Change-Id: Iaddfa9550bdbab807c662595d005126d98cdc277
2016-12-15 11:30:08 -08:00
Chris Craik
2414e1b051 Outline & Path perf improvements
Bug: 33460152
Test: device boots, ViewShowHidePerfTests#add[Factory:NestedLinearLayoutTree,depth:6] 770us -> 650us (userdebug 960MHz bullhead)

Improve perf for outline & simple path methods

native_methodName -> nMethodName in Path.java

Change-Id: Id2374bbaca3256d2e4f19dae9abe67f794a171b3
2016-12-13 16:52:08 -08:00
Chris Craik
7a5ad26406 Merge "Add Outline/RenderNode perf tests" 2016-12-12 21:15:09 +00:00
Chris Craik
2cbbd8d3ab Add Outline/RenderNode perf tests
Bug: 33460152
Test: benchmark CL. Ran new benchmarks.

Change-Id: I6ad5fb3b72c731ef0fb57654191c4b9ac3f6922d
2016-12-09 19:15:53 -08:00
Chris Craik
3f7c6adeef Add benchmarks for different ways to show/hide view subtrees
Bug: 33460152
Test: benchmark CL. Ran new benchmarks.

Change-Id: I7bdd8988543df821eee7b608ea439dfcf54464e5
2016-12-09 16:21:18 -08:00