Issue 1:
Executing same code in 2 machines

Python 3.6.5
numpy==1.14.4

and

Python 3.7.6
numpy==1.17.3

the time it takes in 1.14 is near 3 times faster. Downgrading to 1.14 from 1.17 confirms it:

Issue 2:
Hi, I am seeing a performance regression when migrating from numpy 1.11.0 to 1.16.4. The performance decrease seems to be spread across multiple numpy functions, but here is a simple example which shows a consistent performance difference:

from __future__ import absolute_import
from __future__ import division

import numpy as np
import cProfile

def mean_test(array):
return np.mean(array)

def mean_benchmark():
my_array = np.ones((3, 3), dtype=np.float32)
for _ in range(7600):
mean_test(my_array)

if __name__ == "__main__":
cProfile.run('mean_benchmark()', sort='cumtime')

If I run this 3 times, and pick the best run out of the 3, I get:

For numpy 1.11.0:

91207 function calls in 0.125 seconds

Ordered by: cumulative time

ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 0.125 0.125 <string>:1(<module>)
1 0.003 0.003 0.125 0.125 numpy_benchmark.py:113(mean_benchmark)
7600 0.004 0.000 0.121 0.000 numpy_benchmark.py:9(mean_test)
7600 0.007 0.000 0.118 0.000 fromnumeric.py:2796(mean)
7600 0.055 0.000 0.110 0.000 _methods.py:53(_mean)
7600 0.017 0.000 0.020 0.000 _methods.py:43(_count_reduce_items)
7600 0.020 0.000 0.020 0.000 {method 'reduce' of 'numpy.ufunc' objects}
7600 0.005 0.000 0.006 0.000 numeric.py:484(asanyarray)
15200 0.004 0.000 0.004 0.000 {isinstance}
7600 0.003 0.000 0.003 0.000 {issubclass}
7601 0.003 0.000 0.003 0.000 {range}
7600 0.002 0.000 0.002 0.000 {hasattr}
7600 0.002 0.000 0.002 0.000 {numpy.core.multiarray.array}
1 0.000 0.000 0.000 0.000 numeric.py:148(ones)
1 0.000 0.000 0.000 0.000 {numpy.core.multiarray.copyto}
1 0.000 0.000 0.000 0.000 {numpy.core.multiarray.empty}
1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects}

and for numpy 1.16.4:

98807 function calls in 0.135 seconds

Ordered by: cumulative time

ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 0.135 0.135 <string>:1(<module>)
1 0.004 0.004 0.135 0.135 numpy_benchmark.py:113(mean_benchmark)
7600 0.004 0.000 0.131 0.000 numpy_benchmark.py:9(mean_test)
7600 0.010 0.000 0.127 0.000 fromnumeric.py:3014(mean)
7600 0.062 0.000 0.117 0.000 _methods.py:58(_mean)
7600 0.020 0.000 0.020 0.000 {method 'reduce' of 'numpy.ufunc' objects}
7600 0.016 0.000 0.020 0.000 _methods.py:48(_count_reduce_items)
7600 0.005 0.000 0.006 0.000 numeric.py:541(asanyarray)
15200 0.005 0.000 0.005 0.000 {issubclass}
15200 0.004 0.000 0.004 0.000 {isinstance}
7601 0.003 0.000 0.003 0.000 {range}
7600 0.002 0.000 0.002 0.000 {hasattr}
7600 0.002 0.000 0.002 0.000 {numpy.array}
1 0.000 0.000 0.000 0.000 numeric.py:175(ones)
1 0.000 0.000 0.000 0.000 {numpy.copyto}
1 0.000 0.000 0.000 0.000 {numpy.empty}
1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects}

The numpy/python version information printouts are:

For numpy 1.11.0:

('1.11.0', '2.7.12 (default, Nov 12 2018, 14:36:49) \n[GCC 5.4.0 20160609]')

For numpy 1.16.4:

('1.16.4', '2.7.12 (default, Nov 12 2018, 14:36:49) \n[GCC 5.4.0 20160609]')

I'm using pip install to install these different versions of numpy, and I'm running these tests on a machine with Ubuntu 16.04 with a i7-8650U CPU.

It's not a huge difference, but it seems to be consistent and also seems to affect other numpy operations as well. I am seeing a ~5 % decrease in run time for my overall code. I've also tested a few different versions of numpy (1.12.1, 1.13.3, 1.14.5, 1.15.4), and all seem to be slower than 1.11.0.