Jan-23-2020, 04:23 PM
cpython compiles python 2.7 to super fast C code. then that compiles with gcc down to your architecture machine code. I think you can use the old numpy made for python 2.7 with cpython.
one thing I learned about numpy and python 3 is that you only get bad performance when you pick the wrong data types. fixed point decimal was slow but unsigned integers of a fixed size are fast. python resizes memory for integers at run time so it is even slow with integers by default. setting the memory size before run time is something that is always done in C. this is why when you do it in python you can get close to the performance in C. at some point you will need to just drop python completely and move to openMP + C or fortran. if you have a GPU workload it will be the cuda dev kit and C compiled in gcc. how hard do you want to work for that extra performance?
one thing I learned about numpy and python 3 is that you only get bad performance when you pick the wrong data types. fixed point decimal was slow but unsigned integers of a fixed size are fast. python resizes memory for integers at run time so it is even slow with integers by default. setting the memory size before run time is something that is always done in C. this is why when you do it in python you can get close to the performance in C. at some point you will need to just drop python completely and move to openMP + C or fortran. if you have a GPU workload it will be the cuda dev kit and C compiled in gcc. how hard do you want to work for that extra performance?