Performance

  1. Eliminate arrays whenever possible Example: Input data into an array and then compute average

  2. Traverse arrays sequentially rather than jump around in order to maximize memory performance

  3. Compilers and optimizers assume that arrays are traversed in order.

  4. Maximize locality of reference. Best done by minimizing memory space used.

Code Examples