Lately we had performance complaints from Sourcetree users even after a series of optimizations took care of the obvious issues we could find. While we could see spin logs for various paths that were still heavy, there was nothing jumping out anymore.
At this point I needed more data to help spread out more of a map to guide me to the problem. I broke out Instruments and created the template pictured below which I’ve lovingly dubbed “The Sledgehammer” 🔨
With this in place the frequent disk accesses for typically unused preferences in theme coordinators showed up along with their dangling KVO objects. The stutters made sense.
A bit of refactoring narrowed the scope of both KVO and prefs reading to the minimal areas necessary and we’re back to having a happy little 🌳