If you’re having issues regarding performance, i.e. application is slow, a quick and dirty solution can be to
- trigger slow code (from UI, etc.) and then
- press pause button in the IDE
Chances are that two out of three times call stack will be stuck in the expensive method call.
Then, you can simply have a glance at what each method does:
fun innocentMethod1() {
innocentMethod2()
}
fun innocentMethod2() {
innocentLookingMethod()
}
Nothing suspicious here.
But, move on and you might see something like:
fun innocentLookingMethod() {
for (i in 1..1000000) {
innocentMethod3(i)
}
}
which should be a good enough starting point for further work.
Credits
Credits for the idea, however it may seem simple, are due to a blog or forum post somewhere, sometime.