Have a look at:
- tracing the main thread (is it stalling, why is it stalling/what's happening) instead of polling: https://blog.p-y.wtf/tracing-main-thread-messages
- Utilizing
Looper.getMainLooper().dump();instead of mainthread.getStackTrace()
- Using internal APIs to retrieve the topmost entry from
Looper.getMainLooper()directly
- Have a look into competitors implementation logic
- Have a look if we can collect external signals (e.g. device gets hot, causing CPU throttling, etc…)
- etc..
and see if they would provide any detailed value.
Out of scope:
- Having a look Perfetto System Traces, as this could be a project of it's own.
Timebox to 4d.
Have a look at:
Looper.getMainLooper().dump();instead ofmainthread.getStackTrace()Looper.getMainLooper()directlyand see if they would provide any detailed value.
Out of scope:
Timebox to 4d.