From: Alvaro T. C. <al...@mi...> - 2012-06-29 00:09:48
|
Thank you Josh, that is representative enough. In my system the speedup of structured arrays is ~30x. A copy of the whole array is still ~6x faster. -á. On Thu, Jun 28, 2012 at 10:13 PM, Josh Ayers <jos...@gm...> wrote: > import time > import numpy as np > > dtype = np.format_parser(['i4', 'i4'], [], []) > N = 100000 > rec = np.recarray((N, ), dtype=dtype) > struc = np.zeros((N, ), dtype=dtype) > > t1 = time.clock() > for row in rec: > pass > print time.clock() - t1 > > t1 = time.clock() > for row in struc: > pass > print time.clock() - t1 |