square / papa

PAPA: Performance of Android Production Applications
Apache License 2.0
351 stars 15 forks source link

Improve tracking on choreographer frame ends #68

Closed pyricau closed 4 weeks ago

pyricau commented 1 month ago

Behavior changes

Whenever possible (i.e. any API != 28), we'll now detect the end of a frame by spying on main thread messages and running code right when the main thread message is done running and before a new main thread message starts running, by leveraging Looper.getMainLooper().setMessageLogging { }. We're also detecting whether we're in a frame or not by looking at the name of the runnable, rather than by creating a stacktrace.

Non backward compatible API changes

New APIs