Why is numba faster than numpy here?

后端 未结 4 1569
庸人自扰
庸人自扰 2020-12-24 02:26

I can\'t figure out why numba is beating numpy here (over 3x). Did I make some fundamental error in how I am benchmarking here? Seems like the perfect situation for numpy,

4条回答
  •  暖寄归人
    2020-12-24 03:06

    Numba is generally faster than Numpy and even Cython (at least on Linux).

    Here's a plot (stolen from Numba vs. Cython: Take 2): Benchmark on Numpy, Cython and Numba

    In this benchmark, pairwise distances have been computed, so this may depend on the algorithm.

    Note that this may be different on other Platforms, see this for Winpython (From WinPython Cython tutorial):

    Benchmark on Numpy, Cython and Numba with Winpython

提交回复
热议问题