Tuesday, July 9, 2019

lagging - Approaches for diagnosing input lag / performance problems


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 !


No comments:

Post a Comment

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...