Command-Line Tools

Mac OS X comes with a number of command-line tools for tracking down particular types of performance problems. The nice thing about the command line is that you can remotely log into a machine and watch things as they happen. They also don’t interfere with your application’s user interface.

time

The simplest tool is time. It times command execution and shows you clock time, CPU time in userspace, and CPU time spent in the kernel. Here is a run of /usr/bin/time on TextEdit. The time measured was the time starting TextEdit up, loading /usr/share/dict/words, and then scrolling from the top to the bottom.

$​ ​t​i​m​e​ ​/​A​p​p​l​i​c​a​t​i​o​n​s​/​T​e​x​t​E​d​i​t​.​a​p​p​/​C​o​n​t​e​n​t​s​/​M​a​c​O​S​/​T​e​x​t​E​d​i​t​ r​e​a​l​ ...

Get Advanced Mac OS X Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.