I just found that using Trace.beginSection can help troubleshoot performance issues while using systrace tool. The documentation states "This tracing mechanism is independent of the method tracing mechanism offered by Debug#startMethodTracing"
But just like debug logs, do we need to comment/remove Trace API before releasing the app. Or is it allowed/benign to leave Trace API invocations in release code?
Preparing for release checklist does not mention anything about trace API.
But I am doubtful because there are other methods like Trace.setCounter which can be used to log debug info.
Typically I remove the traces when I'm done with them but Google leaves it in for some of the most basic building blocks like
RecyclerViewso it's probably fine.Here's an example from the
RecyclerViewsource: