Monday, March 23, 2009

OSX Performance Analysis: Instruments

I started working with OSX's Instruments performance analysis tool, partly out of curiosity and partly because I had just fixed a performance problem in an application using an ad hoc a priori analysis. It happened to solve the problem, but I have enough experience with performance issues to know that the a priori guess is often wrong.

Instruments is heavily related to dtrace and shares a lot of its core attributes. The key attributes are that it is low overhead and works with (almost) anything running on your systems (OSX apparently has the capability for some applications to turn off monitoring for security/DRM reasons).

There's a lot to like here: you can easily get it up and going on your system and it the analysis section is very user friendly:


Especially nice features include
  • Low overhead: the peak CPU usage I saw for the tool was ~ 16%
  • The ability to display exactly what is going on under the read head (the upside down triangle above the graph)
  • Being able to display parameters that you didn't think of turning on during the run. All parameters are captured. The selection only impacts the display -- a godsend for anyone who has had to rerun a test because they forgot to capture a parameter

That said, I couldn't get any particular instrument to focus only on the process specified. As you can see, all of the instruments capture all of the activity, even though they were set to focus on different processes. Additionally, the "default action" kept resetting whenever I dragged a new instrument onto the display.

It is still a very worthwhile tool, but if anyone has any tips as to how to get around these issues, I'd appreciate it.

Wednesday, March 4, 2009


It's a bit off topic, but I thought I'd point out how useful a Kindle can be for consulting. You can carry at least 500 reference books on it (and who needs more than 490 anyhow?). It is also very light and easy to read.

I do have a couple of qualms. It is a page oriented display (no scrolling), no touchscreen and has no spatial indexing e.g., the top side of the right page half way in, but other than that it's a win.

An important note on utility: O'Reilly e books can be read on the Kindle. The truly great thing about O'Reilly's e-books is that you get both the Kindle compatible mobiPocket files and the more aesthetically pleasing PDF files (for me, aesthetics matter--even in a SQL guide).

You can mix and match reading and reference between the formats depending upon your preference. Thankfully the files aren't copy protected. Thanks, O'Reilly, this is a very nice touch.