Development Environment | ![]() ![]() |
What Is Profiling?
Profiling is a way to measure where a program spends its time. Measuring is a much better method than guessing where the most execution time is spent. You probably deal with obvious speed issues at design time and can then discover unanticipated effects through measurement. One key to effective coding is to create an original implementation that is as simple as possible and then use a profiler to identify bottlenecks if speed is an issue. Premature optimization often increases code complexity unnecessarily without providing a real gain in performance.
Use the profiler to identify functions that are consuming the most time, then determine why you are calling them and look for ways to minimize their use. It is often helpful to decide whether the number of times a particular function is called is reasonable. Because programs often have several layers, your code may not explicitly call the most expensive functions. Rather, functions within your code may be calling other time-consuming functions that can be several layers down in the code. In this case it's important to determine which of your functions are responsible for such calls.
The profiler often helps to uncover problems that you can solve by:
When you reach the point where most of the time is spent on calls to a small number of built-in functions, you have probably optimized the code as much as you can expect.
![]() | Improving M-File Performance - the Profiler | Using the Profiler | ![]() |