Indirect array access may impact performance.
Accessing an array indirectly (eg. through another array containing the positions to be accessed) is generally less efficient than accessing consecutive positions because the latter maximises data locality. Maximizing data locality increases the performance thanks to the cache levels available in modern processors.
Consider using techniques like loop fusion, loop interchange, loop tiling or changing the data layout to avoid non-sequential access in hot loops.
Get started with Parallelware Analyzer today
Boost the performance of your code