4 ms·
Numba and Cython are faster than C? In my experience, C is the fastest, and the baseline. Was the C compiled with the right optimization flags? It'd be interes
by skierscott 13y ago
Numba and Cython are faster than C? In my experience, C is the fastest, and the baseline. Was the C compiled with the right optimization flags?
It'd be interesting to see a comparison to Matlab's JIT. Is Numba competitive?
- onalark 13y agoNumba and Cython are faster (for very small kernels) than Python interfacing into a C kernel via ctypes. This is not the same thing as a C kernel as part of a C application. I hope I didn't falsely give that impression! You can see that for medium-size and above kernels, the call overhead makes very little impact on the code execution speed. The C was compiled with the same flags used to compile Python. In this case: -O2 -g. I don't have access to a MATLAB license to compare, but I would love to see this comparison done. Let me know if you need any help putting it together.