you replaced memory views by np.ndarray here, right? doesn't that make a big difference in performance? (It's probably a stupid question as I don't know much about this code)