The out kwarg in numpy arrays allows to pre-allocate arrays and thereby avoid unnecessary allocations. This is often the first and easiest optimization. We should consider using it, e.g. benchmark some of the present examples and/or create a specific example where this shines. Even if it isn't more efficient than the numba approach, it might be a lower barrier.
The
out
kwarg in numpy arrays allows to pre-allocate arrays and thereby avoid unnecessary allocations. This is often the first and easiest optimization. We should consider using it, e.g. benchmark some of the present examples and/or create a specific example where this shines. Even if it isn't more efficient than thenumba
approach, it might be a lower barrier.