Open coretl opened 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
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)
There are 3 possible approaches to this:
ophyd.v2.SignalRW
support Locatable by addinglocate()
that returnsget_value()
and the last known put value. Walk the tree of PandA objects, producing all theSignalRW
instances as a list. Thesave
plan will emit a singleMsg('locate', *signals)
message, and return a list of{signal_name: signal_readback}
settings. The ordering of this list is Device specific, for PandA, all units must be set in a separate phase before any other signals. Theload
plan will do anabs_set(signal, group=f"load-phase{phase}", wait=False)
for each signal in each phase, thenbps.wait(f"load-phase{phase}")
.load
plan should first do alocate()
on everything, and only change the values that are differentsave
andload
functions that do the above by callingreadbacks = asyncio.gather(signal.get_value() for signal in signals)`` and
signal.put()`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.