Examples.Array
Class Loop

java.lang.Object
  extended byExamples.Array.Loop

public class Loop
extends java.lang.Object

Computing the sum over all x[i]*x[j], i,j=0,...,N-1 in two different loops which do exactly the same operations just accessing the array elements in different order. Why are the relative speeds of the loops so dramatically dependent on N when N is so small the array fits in the L1 data cache???


Constructor Summary
Loop()
           
 
Method Summary
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Loop

public Loop()
Method Detail

main

public static void main(java.lang.String[] args)