Often performance work is a combination of data collection, debugging, and iterative code changes. Of course the goal is to find the minimum set of changes for the maximum speed win, but that's not easy. Performance work can also be a big time suck, and something that is never finished. Ideally, you should collect profiling data on an optimized build. A debug build is compiled without optimizations, and often has debug code which can strongly skew performance results, including data-verification code, and printf s.
Gecko is known to have some debug-only calls that are slow.
That said, I often collect profile data using the Instrumentation SDK because I like to be able to easily debug in the same build that I profile with, and debugging is much easier when building without optimizations. There are two main tools available for Mac performance measurement. As a result, you may find yourself using both to investigate performance problems. The Metrowerks Profiler is a code-instrumenting profiling tool which requires that you rebuild the sources with the profiling turned on. So changing this will turn on profiling for the entire application.