bluesky / ophyd-epics-devices

https://bluesky.github.io/ophyd-epics-devices
Apache License 2.0
1 stars 1 forks source link

Work out the most performant way to do load/save #28

Open coretl opened 1 year ago

coretl commented 1 year ago

There are 3 possible approaches to this:

To do this, you need the IOC + ophyd + ophyd-epics-devices PandA setup, then save its setup, then modify 10 or so signals, then load the saved setup back over the top. Do this a few times with the different approaches and measure how long each takes. timeit might be a useful module for this.

olliesilvester commented 1 year ago

Here's what I've found so far:

The saving part for all of these methods takes the same amount of time (~0.14s), which makes sense as that part isn't changing.

Loading a panda configuration by changing every PV takes about ~0.29s, and approximately 0.1s of this is the synchronous waiting that occurs between the two loading phases. Loading the panda by only changing differing PV's when no PV's differ takes ~0.16s . This number gradually increases as the number of differing signals change, with a jump of ~0.1s when there are differing signals in both phases.

There doesn't seem to be any significant difference in CPU loads of the function between all of these methods.

From this, it seems like the best option is the second method (bluesky and ophyd are identical performance-wise) as the load function is almost 2x faster when the PandA is already in the correct state

coretl commented 1 year ago

Thanks for doing this. As the values are similar, I think we will go with the simpler (and hopefully more robust) method of setting every parameter. Although it is a bit slower, it is much faster than all the other things we do in stage (like moving motors and arming detectors)