views:

457

answers:

5

I'm writing an iPhone game in objective-C using XCode. I'd like to profile the performance of my code. What is a good profiler to use?

+2  A: 

Apple provides a program called Instruments, which is included with the iPhone SDK download, that really is excellent. It allows you to view memory leaks, animation performance, and a bunch of other stuff.

zPesk
+4  A: 

Have you tried Shark? it comes with the developer tools.

CarbonX
+1  A: 

Shark is an incredible profiler, included as part of Apple's CHUD tools, with XCode. If you can get that to run in, say, the simulator, you will be extremely pleased with the results it provides.

Dave Gamble
+1  A: 

The developer tools you downloaded also included a great app called Instruments. You'll find it in your Developer folder next to Xcode:

/Developer/Applications/Instruments.app

Instruments works great for profiling and also has some preset modes that you can use to track down memory leaks, view how many instances of various objects have been created, monitor your OpenGL performance, etc.

To use Instruments, just build your app in Xcode, then while still in Xcode, launch Instruments from:

Run > Start With Performance Tool > Instruments Templates

…then select the type of performance monitoring you'd like to do.

joshbuhler
+1  A: 

Just wanted to plug a set of profiler macros I created for iPhone. You can profile in the traditional sense vs sampling w Shark. It also doesn't require any special tools and the output is saved to a file in your app's Documents folder.

http://code.google.com/p/iphone-quick-profiler/

.n

nielsbot