Use in-place ops and axpy whenever possible for performance. For this line, it is equivalent to 
~~~
currMean = prevMean :* (cnt / (cnt + 1.0))
axpy(1.0/(cnt+1.0), currData, currMean)
~~~
So you only create one temp array. You can also put this temp storage into `aggregate`'s initial value set to avoid object creation.