Skip to content

Samples to show APIs and best practices in Performance on Android

License

Notifications You must be signed in to change notification settings

YingChen0605/performance-samples

 
 

Repository files navigation

Android Performance

A collection of samples using the performance libraries.

You can learn more about Android Performance at https://d.android.com/performance.

This sample shows how to use the Macrobenchmark library for testing application startup and runtime performance cases, such as scrolling a RecyclerView or LazyColumn to measure jank.

Baseline Profiles can be generated with the Macrobenchmark library. This sample contains code to generate a baseline profile.

The sample also includes a GitHub workflow to run Macrobenchmarks on Firebase Test Lab. For more information refer to the README.md.

The Macrobenchmark sample also demonstrates using Jetpack Compose with Macrobenchmark.

This sample shows how to use the Benchmark library to benchmark code and UI from library modules.

Important Notes

  • Make sure your device's screen is on before running benchmarks

This sample shows how to set up and use the JankStats library to detect janky frames.

Reporting Issues

You can report an Issue with a sample using this repository. If you find an issue with a specific library, report it using the corresponding issue tracker link available in the sample README file.

Additional Resources

PagingWithNetworkSample

  • Example of benchmarking an androidx.paging backed RecyclerView

WorkManagerSample

  • Example of benchmarking asynchronously scheduled background work

License

Copyright 2022 The Android Open Source Project, Inc.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
See the NOTICE file distributed with this work for additional information regarding copyright
ownership.  The ASF licenses this file to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.  You may obtain a copy of the
License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied.  See the License for the specific language governing permissions and limitations under the
License.

About

Samples to show APIs and best practices in Performance on Android

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Kotlin 93.4%
  • TypeScript 6.3%
  • Shell 0.3%