I recently came across a great SO post in which a user suggests that numpy.sum
is faster than Python's sum
when it comes to dealing with NumPy arrays.
This made me think, are element-wise operations on NumPy arrays faster with NumPy functions than operators? If so, then why is this the case?
Consider the following example.
import numpy as np
a = np.random.random(1e10)
b = np.random.random(1e10)
Will np.subtract(a, b)
be reliably faster than a - b
?