title: Speeding up numpy.dot
body: <p>I've got a <code>numpy</code> script that spends about 50% of its runtime in the following code:</p>
  
  <p><code>s = numpy.dot(v1, v1)</code></p>
  
  <p>where</p>
  
  <p><code>v1 = v[1:]</code></p>
  
  <p>and <code>v</code> is a 4000-element 1D <code>ndarray</code> of <code>float64</code> stored in contiguous memory (<code>v.strides</code> is <code>(8,)</code>).</p>
  
  <p>Any suggestions for speeding this up?</p>
  
  <p><strong>edit</strong> This is on Intel hardware. Here is the output of my <code>numpy.show_config()</code>:</p>
  
  <pre><code>atlas_threads_info:
      libraries = ['lapack', 'ptf77blas', 'ptcblas', 'atlas']
      library_dirs = ['/usr/local/atlas-3.9.16/lib']
      language = f77
      include_dirs = ['/usr/local/atlas-3.9.16/include']
  
  blas_opt_info:
      libraries = ['ptf77blas', 'ptcblas', 'atlas']
      library_dirs = ['/usr/local/atlas-3.9.16/lib']
      define_macros = [('ATLAS_INFO', '"\\"3.9.16\\""')]
      language = c
      include_dirs = ['/usr/local/atlas-3.9.16/include']
  
  atlas_blas_threads_info:
      libraries = ['ptf77blas', 'ptcblas', 'atlas']
      library_dirs = ['/usr/local/atlas-3.9.16/lib']
      language = c
      include_dirs = ['/usr/local/atlas-3.9.16/include']
  
  lapack_opt_info:
      libraries = ['lapack', 'ptf77blas', 'ptcblas', 'atlas']
      library_dirs = ['/usr/local/atlas-3.9.16/lib']
      define_macros = [('ATLAS_INFO', '"\\"3.9.16\\""')]
      language = f77
      include_dirs = ['/usr/local/atlas-3.9.16/include']
  
  lapack_mkl_info:
    NOT AVAILABLE
  
  blas_mkl_info:
    NOT AVAILABLE
  
  mkl_info:
    NOT AVAILABLE
  </code></pre>