|Programming and Data Types|
Using Information in the Profiler Reports
These are some guidelines for using the information provided by the Profiler reports.
Process for Improving Performance. Here is a general process you can follow to use the Profiler to improve performance in your M-files.
loadstatement within a loop,
loadis called every time the loop is called. You might be able to save time by moving the
loadstatement so it is before the loop and therefore is only called once.
clear all. Run the Profiler again and compare the results to the original report. Note that there are inherent time fluctuations that are not dependent on your code. If you profile the exact same code twice, you can get slightly different results each time.
Using the Profiler for Debugging. The Profiler is a useful tool for isolating problems in your M-files.
For example, if a particular part of the file did not run, you can look at the detail reports to see what lines did run, which might point you to the problem.
You can also view the lines that did not run to help you develop test cases that exercise that code.
If you get an error in the M-file when profiling, the Profiler provides partial results in the reports. You can see what ran and what did not to help you isolate the problem. Similarly, you can do this if you stop the execution using Ctrl+C, which might be useful when a file is taking much more time to run than expected.
Using the Profiler for Understanding an M-File. For lengthy M-files that you did not create or that you have not used for awhile and are unfamiliar with, you can use the Profiler to see how the M-file actually worked. Use the Profiler detail reports to see the lines actually called.
If there is an existing GUI tool (or M-file) similar to one that you want to create, start profiling, use the tool, then stop profiling. Look through the Profiler detail reports to see what functions and lines ran. This helps you determine the lines of code in the file that are most like the code you want to create.
|File Listing||Changing Fonts for the Profiler|