MATLAB Compiler    

Optimizing Loops

Simple Indexing

(array_indexing) This optimization improves the performance of simple one- and two-dimensional array index expressions. Without this optimization, all array indexing uses the fully general array indexing function, which is not optimized for one- and two-dimensional indexing. With this optimization enabled, indexing uses faster routines that are optimized for simple indexing. For example:

If you compile this with the -O none option, you get

Compiling with -O none -O array_indexing:on gives

The mclArrayRef2 function is optimized for two-dimensional indexing. mclArrayRef1 is used for one-dimensional indexing.


  Scalars Loop Simplification