Shark

Submitted by reeses on Sun, 2004-01-25 16:35.

Shark is the shibnibble. I discovered this last night at Ranchero, and played around with it to optimise some Objective C/Foundation Kit stuff I had written.

Easiest. Profiler. Ever.

Admittedly, it doesn't give you all the information a profiler would. However, if you're concerned primarily with opportunistic optimisation, cpu utilisation, and hot spots in your code, literally five minutes with this baby will melt that stick of butter in your pocket.

How easy is it?

  1. Install Shark, which you will probably have to do because, if you're like me, you're afraid of letting anything called CHUD onto your machine. It's on the XCode CD.
  2. You'll probably have to run the CHUD updater, in /Developer/Applications/Performance Tools/CHUD, to get everything brought up to speed.
  3. Close all your other apps, if you want. Or not.
  4. Start Shark, in the same directory, and click "Start".
  5. Start your app. Play around with it, doing the stuff you're interested in speeding up.
  6. Click "Stop" on Shark.
  7. Click "Tree" mode and find your hotspots. Double-click to see the code.

No, I didn't leave out the part where you recompile your application with profiling flags. No, I didn't leave out the part where the app was insanely slow while profiling was going on.

I suspect it's a shame, however. While I've been working primarily in Java for five or more years now, I've been doing all of my Mac coding in Objective C. I realised the silliness of it, as all of the AppKit/FoundationKit stuff is exposed to Java. I like my Java IDE* better, I like Java gc better, and, honestly, except for dynamic code, I like Java better than *C.

The reason I suspect it's a shame is that I'm not at all sure how well Shark will work with Java, and Shark is just...so...nice.

*Speaking of which, IDEA 4.0 doesn't look all that impressive from an upgrade perspective. I can't recall if I bought the maintenance when I bought my license, either. If I did, I'll upgrade, but otherwise...probably not.

Post new comment

Captcha Image: you will need to recognize the text in it.
Please type in the letters/numbers that are shown in the image above.