title: Understanding performance of numpy memmap
body: <p>I'm trying to better understand how numpy's memmap handles views of very large files. The script below opens a memory mapped 2048^3 array, and copies a downsampled 128^3 view of it</p>
  
  <pre><code>import numpy as np
  from time import time
  
  FILE = '/Volumes/BlackBox/test.dat'
  array = np.memmap(FILE, mode='r', shape=(2048,2048,2048), dtype=np.float64)
  
  t = time()
  for i in range(5):
      view = np.array(array[::16, ::16, ::16])
  t = ((time() - t) / 5) * 1000
  print "Time (ms): %i" % t
  </code></pre>
  
  <p>Usually, this prints <code>Time (ms): 80</code> or so. However, if I change the view assignment to</p>
  
  <pre><code>view = np.array(array[1::16, 2::16, 3::16])
  </code></pre>
  
  <p>and run it three times, I get the following:</p>
  
  <pre><code>Time (ms): 9988
  Time (ms): 79
  Time (ms): 78
  </code></pre>
  
  <p>Does anybody understand why the first invocation is so much slower?</p>