The first step to optimizing your project's processing time is to generate a trace file from the Matrox Profiler; the file includes statistics that will provide a very useful overview of the project's execution including, for example, the duration of individual steps. This might be the quickest way to cut out large chunks of unproductive processing time. For more information on generating a trace file, see the Profiling and troubleshooting logs section later in this chapter.
With this overview in mind, there are a number of optimizations you can still perform in your flowchart and operator view at design-time to reduce the amount of processing required when the project is deployed:
At design-time the project's execution time is determined by your host CPU, but the typical desktop computer is significantly faster than a supported Matrox smart camera's processor. Therefore, timing results at runtime are very different from the timing results at design-time, and it might be beneficial to adjust the Timeout of a particular step accordingly, using the information in the Matrox Profiler's generated trace file. The default Timeout for most steps is 2 sec.
Whenever possible, specify the number of occurrences you expect to find when using the PatternMatching step, the StringReader step, or the CodeReader step. The default settings will try to find all occurrences, even though you might only be interested in finding a specific few.
Whenever an Analysis and Processing step needs to work with an image, specifying a search region will force it to only work inside that region and ignore the rest of the image. This can eliminate unnecessary work, and minimize any unwanted noise that might affect the usefulness of the step's results. For more information, see the Search regions section in Chapter 2: Building a project.
If you are using an ImageProcessing step and the processing destination(s) will fill the entire output image, you do not need to initialize the destination buffer. Set the Image property to None and ClearImage to False to save the processing time required to perform a copy or clear.