Jetpack Compose performance testing

Overview

Jetpack Compose performance testing ( 🚧 WIP)


🛑 Disclaimer

This project is not official, and the information is provided as-is.

All test cases described by the author are based only on his experience and knowledge of the technology at the moment and may not reflect the actual state of affairs.

The information contained here can not be considered the only source of truth and serves solely as general information about Jetpack Compose's performance.

Make any conclusions only at your own discretion.


About

The goal of this project is to benchmark various aspects of the UI framework. It tries to cover as many scenarios as possible — medium complexity list scrolling, animation, recomposition, custom layouts, canvas, etc.

The project uses the official Macrobenchmark library to perform testing.

Devices used for testing:

  • Samsung Galaxy S10, Galaxy S21 (Exynos variants), Android 11;
  • OnePlus Nord N10, Android 11;
  • Pixel 2XL, Android 11;
  • Xiaomi Mi 6, Android 9.

Tested Jetpack Compose versions:

  • 1.0.3
  • 1.0.4
  • 1.0.5
  • 1.1.0-beta01
  • 1.1.0-beta02

The project is continuously updating.


Benchmarking

A generalized performance graph for the tested devices:

⚠️ this graph represents performance status based on project tests only ⚠️


All tests run with the same setup:

  • 2 runs, 2 warmups;
  • warm startup wode;
  • SpeedProfile compilation mode;
  • Android Gradle Plugin 7.0.3;
  • R8 optimizations enabled.

View all benchmarks summaries HERE.


How to run

  • clone the repository;
  • to run the tests only open the TweetListBenchmark.kt and run as regular tests in your Android Studio;
  • to generate full report:
    • install externally plotly-orca tool. The orca command must be available on the command line (added to the system environment);
    • open the terminal inside the root of the project(where benchmark.sh is located);
    • connect your android device, unlock the screen, execute the shell script and wait (about an hour, you may see errors in the log, keep calm and wait until it says “done” or stops running the command)
    • the reports should be located here in a folder named according to your device model.
  • to run a specific JP Compose version test and produce a report:
    • checkout to the desired compose-x.x.x branch;
    • open the terminal in the android-client directory and run the command ./gradlew: benchmark:go(the orca is required too, see above), with your Android device connected before.

FAQ

  • what are these P50 and P90 on the charts?These are percentiles. Read more in Wikipedia;
  • why only two(or any other number) runs/warmups?running tests is a laborious operation; checking all versions of Compose on only one device takes about an hour, and during the development of this benchmark, I had to run it many times :) more iterations or warmups improved the accuracy by only a fraction of a percent for me;
  • can these charts be trusted?1) view the source code; 2) read the disclaimer;
  • why does JP Compose is running slower on my device?every Android device is unique, and something might not work as expected. Keep calm, always check the release build with R8 optimizations enabled and profile the code ... and do not forget to report bugs to the official bug tracker.

TODO

  • refactor all the code;
  • make the tests run on multiple devices at the same time;
  • suggest.
You might also like...
Jetpack-Compose-Demo - Instagram Profile UI using Jetpack Compose
Jetpack-Compose-Demo - Instagram Profile UI using Jetpack Compose

Jetpack-Compose-Demo Instagram Profile UI using Jetpack Compose

Jetpack-compose-animations-examples - Cool animations implemented with Jetpack compose
Jetpack-compose-animations-examples - Cool animations implemented with Jetpack compose

Jetpack-compose-animations-examples This repository consists of 4 animations: St

Compose-navigation - Set of utils to help with integrating Jetpack Compose and Jetpack's Navigation

Jetpack Compose Navigation Set of utils to help with integrating Jetpack Compose

Jetpack-compose-uis - A collection of some UIs using Jetpack Compose. built using Katalog

Jetpack Compose UIs This is a collection of some UIs using Jetpack Compose. It i

A simple authentication application using Jetpack compose to illustrate signin and sign up using Mvvm, Kotlin and jetpack compose
A simple authentication application using Jetpack compose to illustrate signin and sign up using Mvvm, Kotlin and jetpack compose

Authentication A simple authentication application using Jetpack compose to illustrate signin and sign up using Mvvm, Kotlin and jetpack compose Scree

An application that i developed with a aim of learning Jetpack compose and many other jetpack libraries
An application that i developed with a aim of learning Jetpack compose and many other jetpack libraries

An application that i developed with a aim of learning Jetpack compose and many other jetpack libraries, The application make use of jikan Api which displays a list of animations,there more details and even trailers of the animations.

A Kotlin library to use Jetpack Compose in Android and iOS. Allow to write UI for both in Kotin. Still experimental as many compose features are not yet available.
A Kotlin library to use Jetpack Compose in Android and iOS. Allow to write UI for both in Kotin. Still experimental as many compose features are not yet available.

Multiplatform Compose A Kotlin library to use Jetpack Compose in Android and iOS. Allow to write UI for both in Kotin. Still experimental as many comp

K5-compose is a sketchy port of p5.js for Jetpack Compose
K5-compose is a sketchy port of p5.js for Jetpack Compose

k5-compose k5-compose is a sketchy port of P5.js for Jetpack Compose Desktop. This library provides you a playground to play with your sketches so you

Pokedex Compose is an independent re-write of a demo application by the name of Pokedex, but written in jetpack compose.
Pokedex Compose is an independent re-write of a demo application by the name of Pokedex, but written in jetpack compose.

Pokedex Compose Pokedex Compose is an independent re-write of a similar project by the name of Pokedex. I am recreating the UI but I am doing it using

Owner
Sergey Yaremych
Sergey Yaremych
ComposeImageBlurhash is a Jetpack Compose component with the necessary implementation to display a blurred image while the real image is loaded from the internet. Use blurhash and coil to ensure good performance.

compose-image-blurhash ComposeImageBlurhash is a Jetpack Compose component with the necessary implementation to display a blurred image while the real

Orlando Novas Rodriguez 24 Nov 18, 2022
An Android imageboard client with the focus on maximum performance, fully written with Jetpack Compose

This project is an experimental playground to try implementing an application entirely with Jetpack Compose without using the old Android UI framework.

Dmitry 31 Dec 30, 2022
Jetpack Compose based project, used to stress-testing compose features / integrations and explore non-trivial functionality

Project containing Jetpack Compose samples For pagination & network images it uses CATAAS. Known issues Navigation-Compose Issue with fast tapping on

Denis Rudenko 59 Dec 14, 2022
Super Heroes Kata implemented using Jetpack Compose and Screenshot Testing.

KataSuperHeroes with Jetpack Compose We are here to learn about Jetpack Compose. We are going to use Jetpack Compose Testing Tools to interact with th

Karumi 18 Dec 15, 2022
Sample repo that demonstrates various options for testing Jetpack Compose applications.

Composing With Confidence This is the sample repository for the Composing With Confidence presentation from Droidcon NYC in 2022. If you run the sampl

Adam McNeilly 9 Dec 2, 2022
A high-performance Android system parasitic container.

Mizuki A high-performance Android system parasitic container. This is a project idea that will be realized in a few years time. License GPL-3.0 Copyri

Fankesyooni 1 Jan 10, 2022
Jetpack Compose Boids | Flocking Insect 🐜. bird or Fish simulation using Jetpack Compose Desktop 🚀, using Canvas API 🎨

?? ?? ?? Compose flocking Ants(boids) ?? ?? ?? Jetpack compose Boids | Flocking Insect. bird or Fish simulation using Jetpack Compose Desktop ?? , usi

Chetan Gupta 38 Sep 25, 2022
A collection of animations, compositions, UIs using Jetpack Compose. You can say Jetpack Compose cookbook or play-ground if you want!

Why Not Compose! A collection of animations, compositions, UIs using Jetpack Compose. You can say Jetpack Compose cookbook or play-ground if you want!

Md. Mahmudul Hasan Shohag 186 Jan 1, 2023
Learn Jetpack Compose for Android by Examples. Learn how to use Jetpack Compose for Android App Development. Android’s modern toolkit for building native UI.

Learn Jetpack Compose for Android by Examples. Learn how to use Jetpack Compose for Android App Development. Android’s modern toolkit for building native UI.

MindOrks 382 Jan 5, 2023
This is a sample app(For beginners - App #2) built using Jetpack Compose. It demonstrates the concept of State Hoisting in Jetpack Compose.

JetBMICalculator This is a sample app(For beginners - App #2) built using Jetpack Compose. It demonstrates the concept of State Hoisting in Jetpack Co

BHAVNA THACKER 3 Dec 31, 2022