3 ms·
I don't think numpy functions are neccessarily multithreaded and probably many are inherently sequential by their nature, so there are definitely case where mul
by fest 4y ago
I don't think numpy functions are neccessarily multithreaded and probably many are inherently sequential by their nature, so there are definitely case where multiprocessing can speed up the overall program.
- bb88 4y agoSomeone once said that python + numpy is probably going to be faster than writing it using basic C++, since numpy is using highly tuned libraries underneath. I don't know for certain this is the case, but I'd like to see some benchmarks about it.
- kelipso 4y agoYou would almost never use raw C++ when working with linear algebra stuff. You use a library like Eigen that interfaces with BLAS, LAPACK, etc., so you definitely get all the advantages of those highly tuned libraries, plus the speed of C++ and potential flexibility of not having to make multiple array copies and so on.
- cozzyd 4y agoRight, but you can use those highly tuned libraries yourself. I do kind of wish numpy had a stable C API that didn't require a Python interpreter though.
- bee_rider 4y agoThey aren’t necessarily threaded, but if you care about Numpy performance on an Intel chip at least you are already using MKL for Numpy’s BLAS, and MKL’s gemm is threaded.