Why numpy performs worst on a more powerful computer?
<p>I have 2 computers:</p>

<ol>
<li>A 2012 Dell Latitude, with a Intel i5 processor, 4 gb of Ram.</li>
<li>A 2016 MacBook Pro, with a (last generation) Intel i5 processor 8 gb of ram.</li>
</ol>

<p>Then, I also have Python program that does extensive use of numpy's libraries, that is able to run on both the computers. This program works with very big float tensors (say with shape <code>500 X 500 X 500</code>)</p>

<p>I am concerned by the following fact: the execution of this code is significantly faster on the 2012 Dell then on 2016 mac, even if I was expecting the opposite behavior, being the newer PC most powerful, under all points of view.</p>

<p>Which might be the case of this behavior? 
Might be important the fact that I used a precompiled numpy installation for the Dell, while I simply used </p>

<pre><code>pip install numpy
</code></pre>

<p>for the mac?</p>

<p><strong>Edit:</strong></p>

<p>This might be due to the different Blas/Lapack libraries installed on the two computers. If I run on the mac I run <code>np.show_config()</code>
I obtain</p>

<pre><code>lapack_opt_info:
    extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
    extra_compile_args = ['-msse3']
    define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
openblas_lapack_info:
  NOT AVAILABLE
atlas_3_10_blas_threads_info:
  NOT AVAILABLE
atlas_threads_info:
  NOT AVAILABLE
atlas_3_10_threads_info:
  NOT AVAILABLE
atlas_blas_info:
  NOT AVAILABLE
atlas_3_10_blas_info:
  NOT AVAILABLE
atlas_blas_threads_info:
  NOT AVAILABLE
openblas_info:
  NOT AVAILABLE
blas_mkl_info:
  NOT AVAILABLE
blas_opt_info:
    extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
    extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
    define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
atlas_info:
  NOT AVAILABLE
atlas_3_10_info:
  NOT AVAILABLE
lapack_mkl_info:
  NOT AVAILABLE
</code></pre>

<p>but I have no idea of how to interprete this..</p>

<p>Valid question imo. If I had to guess, from most likely to less likely:</p>

<ol>
<li><p>The numpy on the 2012 system uses faster BLAS/LAPACK libraries. You can check which are used by running <code>numpy.show_config()</code> on both systems.</p></li>
<li><p>The processor in the 2012 system may actually be faster than the one in the 2016 system. Your macbook has a i5-5287U most likely, with 2.7 ghz base clock and 3.1 ghz boost. In 2012 there exsisted already i5 laptop procssors with 2.9 ghz base clock and 3.6 ghz boost.</p></li>
<li><p>The 2016 system may be running slower than usual, for any number of reasons. Maybe it's overheating or has bloatware or something.</p></li>
</ol>

python numpy