Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Triggering of xspress3 at BMM takes 2.5s for 0.5s exposure #96

Open
mrakitin opened this issue Aug 14, 2020 · 3 comments
Open

Triggering of xspress3 at BMM takes 2.5s for 0.5s exposure #96

mrakitin opened this issue Aug 14, 2020 · 3 comments

Comments

@mrakitin
Copy link
Member

This part of the code seems to be a bottleneck (see the attached picture with the ts_msg_hook-generated output):

def trigger(self):
if self._staged != Staged.yes:
raise RuntimeError("not staged")
self._status = DeviceStatus(self)
self.settings.erase.put(1)
self._acquisition_signal.put(1, wait=False)
trigger_time = ttime.time()
for sn in self.read_attrs:
if sn.startswith('channel') and '.' not in sn:
ch = getattr(self, sn)
self.dispatch(ch.name, trigger_time)
self._abs_trigger_count += 1
return self._status

20200813_155248

@mrakitin
Copy link
Member Author

Did a few tests today with @bruceravel, all repeatable, even with the disabled HDF5 plugin.

@tacaswell, what would be the best way to debug it? Which kinds of prints can help here? I guess this dispatching is doing something very slowly, but not sure how to best approach it.

@jklynch
Copy link
Contributor

jklynch commented Aug 17, 2020

https://github.com/joerick/pyinstrument

@tacaswell
Copy link
Member

I think we may need to throw a whole lot of camonitors on the AD signals to see where it is getting stuck. If we are at the wait message, than that means we are through trigger and are waiting now waiting for the code in

def _acquire_changed(self, value=None, old_value=None, **kwargs):
"This is called when the 'acquire' signal changes."
if self._status is None:
return
if (old_value == 1) and (value == 0):
# Negative-going edge means an acquisition just finished.
self._status._finished()
to fire.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants