You do not need to compile code in debugging mode to profile it. Indeed, profiling works on fully optimized code. However, optimizing can complicate profiler output by introducing new code items.
The only kind of profiling that requires special compilation is call counting: to produce useful results in call-count profiling. Ensure that the listener's preferences dialog Compile for tracing and call-counting check box is checked (Listener > Properties > Compilers calls up the dialog), or that the Shell.Options.Compiler.generateTraceProfileCode option is set to true.