Skip to content

TJYOYO/APerformance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Background

Android apps always face the challenge of CPU and memory threshold; therefore, the library aims to detect, analyze, and optimize performance.

Detect tools

adb shell top and python script

1: check the process name of apps, for example, com.jack.performance

adb shell ps | grep com.jack.performance

2: get the consumption of CPU and memory

adb shell top -p {pid} -H

top

3: Using python script to capture datas, the data will be saved in the Desktop file

source ./venv/bin/activate
python getTop.py com.jack.performance

4: generate the chart figure

source ./venv/bin/activate
python3 cpu-chart.py xxx.txt

top

Option 1: Capture data by command line

1: setup probes(injection), then save the config.gpx

cpu-setup

2: Copy and save the config.gpx

cpu-config

real file -> /configure/cpu-config.gpx

3: execute command

cat config.pbtx | adb shell perfetto -c - --txt -o /data/misc/perfetto-traces/trace.pftrace

4: pull the trace file

adb pull /data/misc/perfetto-traces/trace.pftrace

Systrace

profile (Android Studio)

Analyze

Optimization approaches

About

Optimize performance for Android apps

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages