Improve (g)ufunc performance (#424)