slickr


Source link: https://github.com/ericleong/slickr

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

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_VSYNCHANDLE_INPUT_START time spent by system
input HANDLE_INPUT_STARTANIMATION_START time spent handling input events
animations ANIMATION_STARTPERFORM_TRAVERSALS_START time spent evaluating animators
traversals PERFORM_TRAVERSALS_STARTDRAW_START time spent on layout and measure
draw draw DRAW_STARTSYNC_START time spent on View.draw()
sync prepare SYNC_STARTISSUE_DRAW_COMMANDS_START time spent transfering data to gpu
execute time spent executing display lists
gpu process ISSUE_DRAW_COMMANDS_STARTFRAME_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.

Resources

Very simple Object Relationship Mapping framework (ORM) for Android.

Features:

  • Very minimal configuration.
  • Annotation driven data modeling
  • POJO Entity Classes that are loosely coupled
  • Use of Data Access Objects for CRUD operations

An extension library for the android-percent-support.

AndroidAvatarView allows to use ImageView for avatar.

A simple & clean api for adding PushBullet style skittles to your app for more material design glory.

STF

STF (or Smartphone Test Farm) is a web application for debugging smartphones, smartwatches and other gadgets remotely, from the comfort of your browser.

A powerful ListView with awesome pull-refresh and pull-on-load-more function!

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes