Which MATLAB Profiler Timing Column Should Drive Optimization for Wrapper Functions?
0 reputation · 28 Jan 2026, 10:18 UTC
When a MATLAB function spends most of its execution inside small helper routines, the Profiler can present conflicting signals. Self time isolates the function body, while total time includes every callee. If the helpers are shared across the codebase or already optimized, self time may point to the right target; if the entire call tree is under your control and the user-visible task is slow, total time may be more relevant.
The uncertainty is compounded by measurement noise. Profiler overhead is most noticeable for very short functions, and first-call effects such as parsing or caching can shift rankings before the workload is warmed up. Because behavior can vary by release, guidance based on an older MATLAB version may not apply directly.
Which column should take priority when a wrapper's total time is dominated by many small helpers that are not all under your control? Does the choice change if the helpers are shared utilities versus private methods? How should profiler overhead and release differences factor into the decision before committing to an optimization target?