usnistgov / PyHyperScattering

Tools for hyperspectral x-ray and neutron scattering data loading, reduction, slicing, and visualization.
Other
6 stars 8 forks source link

SST1RSoXSDB: Dramatically improve the performance of `summarize_run` #82

Closed pbeaucage closed 1 year ago

pbeaucage commented 1 year ago

It turns out (after very helpful conversations with @danielballan, thanks!) that one can dramatically speed up iterative fetching of Databroker 2 (Tiled backed) documents by bulk-downloading, for instance:

image This PR takes this MCVE and implements it in SST1RSoXSDB.summarize_run, a worker function for doing Tiled searches.

Other changes:

Resulting performance: a 1184-entry search which used to take 1m 5s now completes in about 14s, filling ~80 runs / second. In testing tonight (when the Tiled server is under less load) I am seeing performance up to ~120 runs / second.