kwgoodman/la — Issue #53: Make larry.push() faster
Author: kwgoodman
Created: 2012-03-08 20:47:29+00:00
State: open

Make larry.push() faster by avoiding a copy.

Old:

I[1] lar = la.rand(1000, 1000)
I[2] lar[lar > 0.8] = np.nan
I[3] timeit lar.push(100)
10 loops, best of 3: 82 ms per loop

New:

I[1] lar = la.rand(1000, 1000)
I[2] lar[lar > 0.8] = np.nan
I[3] timeit lar.push(100)
10 loops, best of 3: 77 ms per loop

Old:

y = self.copy()
y.x = push(y.x, window, axis=axis)
return y

New:

label = self.copylabel()
x = push(self.x, window, axis=axis)
return larry(x, label, validate=False)