on-internet
← Community

Why Numba produces faster binary than ISPC for this simple function?

Stack Overflow ·

I'm testing on Ubuntu 24.04.5, Intel(R) Core(TM) Ultra 5 125H (x64) CPU, Python 3.14.10, numba 0.68.1 and ISPC 1.32.0. This script: import numpy as np, timeit as ti, numba as nb, ctypes lib = ctypes.CDLL("./ispc0.so") lib.ispc0.argtypes = [ np.ctypeslib.ndpointer(dtype=np.uint8, ndim=1, flags="C_CONTIGUOUS"), np.ctypeslib.ndpointer(dtype=np.bool, ndim=1, flags="C_CONTIGUOUS"), ctypes.c_int, ] lib.ispc0.restype = None def ispc0(a, b): lib.ispc0(a, b, a.size) @nb.njit(fastmath=True) def numba0(a, b): rp2 = b[2:-2] am2 = a # formerly a[i-2] am1 = a[1:] # formerly a[i-1] a0 = a[2:] # formerly a[i]

Comments

Sign in or sign up to comment and upvote.

No comments yet.