How come the performance of numpy.linalg.solve has changed drastically between versions 1.26.4 and 2.0.0?
I noticed that numpy.linalg.solve
has vastly different performance since v2.0.0, on both Linux and Windows (haven’t tested it on macOS). Basically, for reasonable matrices (up to about 1800×1800) the new versions are much faster (up to 10x faster of my Linux machine, I got even larger speedups on Windows), then for larger ones (up to about 8800×8800) the 1.26.4 version is faster, and for even larger ones the 2.0.0 version again becomes faster.
Why is it slower when storing the result of numpy.astype in a variable?
The following two functions logically do the same thing, but func2
, which stores the result in a temporary variable, is slower.
Optimize performance of function that creates buffer around non-zero values in numpy array
I have a function that takes a 2 dimensional array, and returns an array of same shape that has a 1 if the value in the original array is next to (horizontally, vertically, or diagonally) a non-zero number, and 0 otherwise.