bluesky / hklpy

Diffractometer computation library with ophyd pseudopositioner support
https://blueskyproject.io/hklpy
BSD 3-Clause "New" or "Revised" License
4 stars 12 forks source link

make util.list_orientation_runs() faster #243

Open prjemian opened 2 years ago

prjemian commented 2 years ago

Execution time of util.list_orientation_runs() is proportional to catalog size. On one workstation, 10 runs/second is typical since this code must be executed for every run to be checked: https://github.com/bluesky/hklpy/blob/f91c18df37ba4ce7feff52fbe60583ca0e106bef/hkl/util.py#L306-L315

Significant optimization is possible by adding a key to the start document metadata that describes if orientation info is available and for what geometries. A use_md_key=True kwarg (default) to util.list_orientation_runs() would support the new key. Old-style search would still be possible by setting use_md_key=False.