Threads profiling
To provide a faster and smoother user experience, you should care about CPU usage. Minimizing CPU usage preserves battery life and makes your application perform well on a mix of newer and older hardware. Thread profiling helps you find out which methods are executed over a period of time. You can also trace a call stack to identify a sequence of method invocations. You can use this information to determine which methods perform unnecessary work.
Threads viewer
The debug tools in IntelliJ IDEA have two very similar tabs—Threads
and Frames
. The Threads
pane give you access to the list of threads that exist as of the current breakpoint. The Frames
pane shows the current method or function that's being invoked. In this tab, you can get more detailed information about local variables. Let's return to our last example:
class Tea class Coffee class Cup<out T>(val drink: T) fun main(vars: Array<String>) { val cupOfTea = Cup(Tea()) val cupOfCoffee = Cup(Coffee())...