NSLS-II / eiger-io

I/O tools for the Eiger detector
BSD 3-Clause "New" or "Revised" License
1 stars 9 forks source link

benchmarking #11

Closed jrmlhermitte closed 2 years ago

jrmlhermitte commented 6 years ago

If we're switching to dask, it would be useful to benchmark somewhere.

I would suggest starting with the 3D time series (ignore events, since anyway CHX usually deals with one event, with the exception of scanning):

imgs # time series images PIMS object
roi1 = # some slice
t1 = time.time()
avgstat = 0
for img in imgs:
    avgstat += img[slice]
avgstat /= len(imgs)
t2 = time.time()
dt_pims =t2-t1

t1 = time.time()
imgs # dask array
avgstat = np.average(imgs[:, slice])
t2 = time.time()
dt_np = t2-t1

something like this @danielballan what do you think?

danielballan commented 6 years ago

That looks sensible to me. I do suggest using a more sophisticated profiling tool (my go-to is the %timeit magic) that takes some measures to avoid getting fooled by caching.