Sunday, July 12, 2009

Shark


Shark is a performance tool that allows you to track CPU usage of your app. In particular, it shows what percentage of time methods in a task usually take. I was unfamiliar with this tool until WWDC. After giving it a shot, I found it incredibly easy to use and reading and interpreting the data isn't too difficult either.

One problem that I was having was the recalculation of skill training times based on the idea that if you add learning skills to the plan, you have to recalculate the training times of all subsequent planned skills. After dragging in a complex skill, such as Caldari Titan, I found the delay pretty unbearable. After running it through Shark, I got the result pictured. 88% adding new items is calculating the attribute values going to be used to determine the training times. 85% (or 97% of the calculations) was spent strictly on fetching managed objects from Core Data. I'm doing far too many repetitive fetches and it's taking quite a toll on the performance. However, Shark has allowed me to pinpoint the source of the problem and now I'm back to the drawing board to find a better algorithm.

1 comment:

  1. Hey Vadim! I just found this site for the first time today. I'm really excited about your efforts. I'll try to find you ingame for a donation.

    ReplyDelete