• This repository has been archived on 03/Feb/2023
  • Stars
    star
    128
  • Rank 279,425 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created over 9 years ago
  • Updated almost 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A collection of python and bash scripts to collect and analyze frame rendering performance in Android apps.

slickr

A collection of python and bash scripts to collect and analyze frame rendering performance in Android apps.

requirements

setup

on device

Make sure to enable the "In adb shell dumpsys gfxinfo" option for "Profile GPU rendering" inside "Developer options" in your settings app!

You may need to kill and restart your app for the logging to work!

on computer

If you can't execute the scripts, you may need to mark them as executable.

$ chmod +x *.sh *.py

should do the trick on Unix-like operating systems, or cygwin.

examples

Scroll for 8 seconds and save the GPU profiling information for the current screen into a file.

$ ./slickr.sh > profile.txt

Scroll for 8 seconds and display the average frame delay (in milliseconds).

$ ./slickr.sh | ./avg.py

Scroll for 8 seconds and plot the recorded data and other metrics.

$ ./slickr.sh | ./plot.py

Compare the frame delay histograms and demand curves of two (or more) saved profiles.

$ ./compare.py profile1.txt profile2.txt

api

$ slickr.sh <package> <iterations> <distance>
  • package is the Java package name for the Android application. For example, for the Tumblr app, it is com.tumblr. It can be gleaned from the play store url for an application.

    If an app has multiple activities open, profile.py will choose the activity with visibility=0 (the currently visibile activity). On devices below Lollipop, all profile data is exported.

  • iterations is the number of 2 second iterations to run (since 128 frames, the default buffer size, is a duration of about 2 seconds at 60 frames per second). Default is 4.

  • distance is the scroll distance in pixels. It defaults to 3x the display density (at the bucket the device belongs to).

framestats in Android Marshmallow (6.0) is automatically enabled as long as a package name is provided. It provides detailed information about the draw stage of the rendering pipeline.

understanding the plots

tumblr app profile

The Android M framestats data is a series of raw timestamps. These are then converted into time deltas according to the Android Developer guidelines. The gfxinfo data is also plotted if available, though there is some overlap.

component gfxinfo framestats timestamps notes
start ↓ INTENDED_VSYNC → HANDLE_INPUT_START time spent by system
input ↓ HANDLE_INPUT_START → ANIMATION_START time spent handling input events
animations ↓ ANIMATION_START → PERFORM_TRAVERSALS_START time spent evaluating animators
traversals ↓ PERFORM_TRAVERSALS_START → DRAW_START time spent on layout and measure
draw draw DRAW_START → SYNC_START time spent on View.draw()
sync prepare SYNC_START → ISSUE_DRAW_COMMANDS_START time spent transfering data to gpu
↓ execute time spent executing display lists
gpu process ISSUE_DRAW_COMMANDS_START → FRAME_COMPLETED time spent waiting on gpu

The green line represents the 16.67 ms threshold needed to achieve a smooth 60 frames per second.

duration curve

The duration curve rearranges the profiling data by sorting it from slowest to fastest frame. This is based off load duration curves in power engineering and illustrates how many frames went over the 16 ms threshold needed for 60 FPS and how many milliseconds they went over.

More Repositories

1

zoomwall.js

A content-focused photo gallery using a horizontal masonry layout that scales up in lightbox mode.
HTML
297
star
2

flipgrid.js

A simple, content-focused photo gallery inspired by Microsoft's Metro interface and CSS 3D transitions.
JavaScript
87
star
3

fisheye.js

A javascript library for applying radial lens distortion to images using WebGL.
JavaScript
70
star
4

scrollshot

A bash script for automatically scrolling and stitching screenshots of Android apps.
Shell
50
star
5

sand.js

A falling sand game as a cellular automaton, powered by WebGL.
JavaScript
34
star
6

forceengine

"My first physics engine."
Java
7
star
7

giftext

Generates animated 3d text as a gif.
JavaScript
5
star
8

pixelmap.js

A javascript library for drawing images to the canvas with reverse pixel mapping using WebGL.
JavaScript
4
star
9

fadefilter

Android app demonstrating a simple fade image filter using OpenGL.
Java
3
star
10

lightblocks.js

A content-focused photo gallery using a horizontal masonry layout that automatically rescales in lightbox mode.
JavaScript
3
star
11

tumblr3d

Tumblr + Google Cardboard
Java
2
star
12

ideashout

IdeaShout is a social aggregator for events and ideas, exploring the connection between space and time.
Python
2
star
13

bentobox

Code for a talk on asynchronous dependency injection.
Java
2
star
14

rubiks

A simple Rubiks cube implementation with arcball-based interaction.
C
1
star
15

giferator-android

Android version of giferator
Java
1
star
16

bubblebattles

Live life as a bubble.
JavaScript
1
star
17

powerdash

Dashboard for energy consumption at 41 Cooper Square.
JavaScript
1
star