# Optimizing PatMax Performance

By configuring the PatMax alignment parameters appropriately, you can achieve the optimum balance between execution speed and robustness for your application. The following table lists the factors that affect PatMax execution speed.

Factor | Effect | Notes
--- | --- | ---
Additional degrees of freedom | Each additional degree of freedom you enable increases the required alignment time. | Only enable a degree of freedom if You expect patterns in your run-time images to vary in this degree of freedom by more than a small amount. or You need to measure this degree of freedom.
Increasing zone size for a degree of freedom | The larger the range of values you specify for a degree of freedom, the longer a PatMax alignment requires. The increase in execution time might not be linearly related to the increase in zone size. | PatMax might return pattern instances that are slightly outside of the range you specify. PatMax only does this if it can do so without increasing the alignment time or decreasing the result accuracy.
Decreasing accept threshold | The lower the accept threshold you specify, the longer a PatMax alignment requires. | You should determine the accept threshold using test alignments.
Number of instances to look for | The more instances you tell PatMax to look for, the longer the alignment may take. | Increasing the number of instances can increase the number of potential matches that PatMax must evaluate.
Run-time area | The larger the run-time area, the longer the alignment takes. | Depending on your application, reduce the size of the run-time area as much as possible.
Pattern size | In general, the larger the size of the trained pattern (in pixels), the faster alignments will run. | Select a training pattern that includes as many pattern features as possible.
Image confusion | The more confusing the image, the longer alignments will take. | Train patterns that are unique within run-time images.
Coarse granularity | In general, the larger the coarse granularity limit, the faster alignments will run. | Use caution in manually changing the coarse granularity limit.
High sensitivity mode | Produces better results for low contrast and noisy images. | Tune the degree of sensitivity with the sensitivity parameter.
Sensitivity parameter | Specifies the amount of pattern noise rejection for high sensitivity mode. | Use the default value for most applications.