You copied the Doc URL to your clipboard.

Recommended loop structure for vectorization

The overall structure of a loop is important for obtaining the best performance from vectorization.

Generally, it is best to write simple loops with iteration counts that are fixed at the start of the loop, and that do not contain complex conditional statements or conditional exits. You might have to rewrite your loops to improve the vectorization performance of the code.