python - How do numpy and GMPY2 compare with GMP in terms of speed? -
i understand gmpy2 supports gmp library , numpy has fast numerical libraries. want know how speed compares writing c (or c++) code gmp. since python scripting language, don't think ever fast compiled language, have been wrong these generalizations before.
i can't gmp work on computer, can't run tests. if could, general math addition , maybe trig functions. i'll figure out gmp later.
numpy , gmpy2 have different purposes.
numpy has fast numerical libraries achieve high performance, numpy restricted working vectors or arrays of low-level types - 16, 32, or 64 bit integers, or 32 or 64 bit floating point values. example, numpy access highly optimized routines written in c (or fortran) performing matrix multiplication.
gmpy2 uses gmp, mpfr, , mpc libraries multiple-precision calculations. isn't targeted towards vector or matrix operations.
the python interpreter adds overhead each call external library. whether or not slowdown significant depends on how time spend external library. if running time of external library short, 10e-8 seconds, python's overhead significant. if running time of external library relatively long, several seconds or longer, python's overhead insignificant.
since haven't said trying accomplish, can't give better answer.
disclaimer: maintain gmpy2.
Comments
Post a Comment