Approaches for diagnosing input lag / performance problems


Question

Recently, my phone (A non-rooted Note 4) has begun to exhibit widespread performance problems. All apps and interactions are affected: the UI pauses frequently and even lightweight soft keyboards (like Samsung's and Google's) struggle to accept my inputs, which are often delayed by 2-3 seconds.



There's clearly something wrong. I'm not trying to fix this so much as I'm looking for a way to get insight into what it might be.



Before you flag as a duplicate -- after all, this question HAS been asked before -- please note that I'm not looking for the kinds of non-answers that have plagued similar questions, such as:




  • Suggestions as to what might be wrong without guidance on how to validate or eliminate the theory. I know what might be wrong but I need to find a way to measure and understand what is actually wrong.

  • Tips and tricks for improving performance in general. Yes, I could uninstall stuff, free up space, hard reset, or take any number of other measures that will speed things up incrementally or drastically. But a spray-n-pray approach misses the point: this question seeks a rational approach for understanding what the right measure to take would be.

  • Pointers to task-killing, cleaning, or other meddlesome "management" type apps. This is a clumsy and naive approach that represents a band-aid to the problem at best.



Diagnostic app suggestions are certainly welcome if they provide meaningful insight into resource usage, performance metrics, or other information that can be applied toward a larger diagnostic process. But this question's goal is that process, or substantial components of it.



As an example, two components of this process would certainly be:




  1. The Application Manager in Android settings has a running process list. This list would show if a single process running in the background was taking up a large amount of memory.


  2. The 'logcat' command in ADB can be used to retrieve (massive) system logs, which may show error, warning, or info messages that expose processes or services that are thrashing and reducing CPU availability and degrading UI responsiveness.




Beyond that, what else needs to be in one's toolbox in order to tackle this problem?


Answer

Assuming your lag is not caused by resource hogging malware (detection and removal covered in tag), possible causes (discounting infamous touchwiz :), could be



  • CPU loading



  • Disk I/O



  • Network I/O



  • RAM ( ignoring this going further given 3 GB RAM of your device )




Two apps would greatly help you in identifying the culprit system / downloaded apps hogging resources mentioned



  • Trepn Profiler by Qualcomm (free app)- this gives a highly configurable view of all the apps that are running when monitored



  • PerfMon - Performance Monitor by Chainfire (paid app less than $3)- this gives a deep dive view of the app running in foreground. Features of this app have been covered in another answer and there is no need to repeat here




Suggested Approach: You could use Trepn Profiler to view all the apps and resource consumption to start with and if you need to study the behaviour of app while it is running (including consolidated CPU usage, instead of separate cores), use Perfmon. Apart from this feature to monitor foreground app performance , all and more features are available in Trepn Profiler


Trepn Profiler is a powerful app and you would want to spend time playing around with it (some features are device chipset constrained- for instance per app network feature doesn't work on my device ( Huawei Honor 6 running Kirin chipset). Notwithstanding this, it is quite handy. Selected features for your purpose from app description (there are quite a few other features)



Key Features


 • Real-time view of individual CPU cores


 • View network usage (cellular and Wi-Fi)


 • Overlays appear on top of applications being profiled


 • Monitor GPU frequency and load


 • Advanced mode to manually select data points and save data for later analysis


 • Displays device power consumption in mW


Advanced Mode Features


• Profile your device or a single app


• Offline data analysis



Some snapshots from app description to give an idea of features


enter image description here


This should give you a head-start in identifying the problematic apps. As mentioned before, do spend time in acquainting yourself with the features of Trepn, to expolit it's versatility to your advantage. Once you home on, you can take a call to uninstall or freeze apps (requires root for system apps). Maybe a good idea to concentrate on social media apps which are by and large big time resource hoggers (including what's between the ears :-)


All the best !


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