Android: Add incremental install benchmark

This CL also adds a new flag for apk_operations.py's logcat command:
--exit-on-match which takes a string and passes that into re.search to
match parsed logcat messages. When a match is found, then logcat exits.

This new feature allows benchmark.py to specify a log message that it
can search for and exit when the app is sufficiently far along in its
startup. For the initial version of this benchmark it waits until the
native library is done loading and the "Successfully loaded native
library" string is found in a logcat message.

An emulator with API level 28 was selected to use as an install target
and fast_local_dev removed as an option. This simplifies benchmark.py
calls and uses a consistent set of GN args for all benchmarks (with the
addition of target_cpu when the emulator is used).

benchmark.py now distinguishes between incremental build-only benchmarks
and incremental build & install benchmarks. Most non-python-script
changes are build only.

Example output:

$ tools/android/build_speed/benchmark.py all_incremental
Summary (using build server; not using emulator)
gn args: target_os="android" use_goma=true incremental_install=true
target: chrome_public_apk
gn gen: 6.5s
chrome_java_nosig: 30.3s avg (31.3s, 29.2s)
chrome_java_sig: 48.2s avg (49.0s, 47.5s)
chrome_java_res: 31.4s avg (28.5s, 34.3s)
module_java_public_sig: 61.6s avg (60.7s, 62.6s)
module_java_internal_nosig: 18.4s avg (18.4s, 18.5s)
base_java_nosig: 22.9s avg (23.6s, 22.1s)
base_java_sig: 157.5s avg (157.3s, 157.8s)

$ tools/android/build_speed/benchmark.py all_incremental --use-emulator
Summary (using build server; using emulator)
gn args: target_os="android" use_goma=true incremental_install=true target_cpu="x86"
target: chrome_public_apk
gn gen: 6.2s
chrome_java_nosig: 49.8s avg (49.4s, 50.1s)
chrome_java_sig: 66.0s avg (64.9s, 67.0s)
chrome_java_res: 48.0s avg (47.1s, 48.9s)
module_java_public_sig: 79.0s avg (81.0s, 77.0s)
module_java_internal_nosig: 30.9s avg (30.4s, 31.4s)
base_java_nosig: 36.9s avg (36.6s, 37.2s)
base_java_sig: 167.6s avg (168.0s, 167.1s)

Bug: 1254718
Change-Id: I13790a4ad727c455d27da12a2509175b06f84f31
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3328322
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Commit-Queue: Peter Wen <wnwen@chromium.org>
Auto-Submit: Peter Wen <wnwen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#951038}
3 files changed
tree: 379b8a05c90954c472234f193de91d9bcb123ee0
  1. android_webview/
  2. apps/
  3. ash/
  4. base/
  5. build/
  6. build_overrides/
  7. buildtools/
  8. cc/
  9. chrome/
  10. chromecast/
  11. chromeos/
  12. cloud_print/
  13. codelabs/
  14. components/
  15. content/
  16. courgette/
  17. crypto/
  18. dbus/
  19. device/
  20. docs/
  21. extensions/
  22. fuchsia/
  23. gin/
  24. google_apis/
  25. google_update/
  26. gpu/
  27. headless/
  28. infra/
  29. ios/
  30. ipc/
  31. jingle/
  32. media/
  33. mojo/
  34. native_client_sdk/
  35. net/
  36. pdf/
  37. ppapi/
  38. printing/
  39. remoting/
  40. rlz/
  41. sandbox/
  42. services/
  43. skia/
  44. sql/
  45. storage/
  46. styleguide/
  47. testing/
  48. third_party/
  49. tools/
  50. ui/
  51. url/
  52. weblayer/
  53. .clang-format
  54. .clang-tidy
  55. .eslintrc.js
  56. .git-blame-ignore-revs
  57. .gitattributes
  58. .gitignore
  59. .gn
  60. .mailmap
  61. .rustfmt.toml
  62. .vpython
  63. .vpython3
  64. .yapfignore
  65. AUTHORS
  66. BUILD.gn
  67. CODE_OF_CONDUCT.md
  68. codereview.settings
  69. DEPS
  70. DIR_METADATA
  71. ENG_REVIEW_OWNERS
  72. LICENSE
  73. LICENSE.chromium_os
  74. OWNERS
  75. PRESUBMIT.py
  76. PRESUBMIT_test.py
  77. PRESUBMIT_test_mocks.py
  78. README.md
  79. WATCHLISTS
README.md

Logo Chromium

Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.

The project's web site is https://www.chromium.org.

To check out the source code locally, don't use git clone! Instead, follow the instructions on how to get the code.

Documentation in the source is rooted in docs/README.md.

Learn how to Get Around the Chromium Source Code Directory Structure .

For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.

If you found a bug, please file it at https://crbug.com/new.