-
Notifications
You must be signed in to change notification settings - Fork 43
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
redundant time-consuming insertion of electrodes during import #1121
Comments
I see. Each make function is running on all entries in the nwb file spyglass/src/spyglass/common/common_ephys.py Line 129 in 094e002
However, the key source of the table is specific to the electrode group, so the make function gets called once per each group in the
I'm a little surprised that each call is taking so long. Do you know what part of the Electrode make function is using the time? |
(disregard my deleted comment... investigating some more to answer your question) |
I think it might be this
because it's making a query to the database at each iteration. Would that make sense? Maybe this check is not needed? |
actually it doesn't seem to be that. Investigating further.... |
Okay I'm pretty sure that the slow part is the
Can anything be done to avoid that? |
It looks like We could try to reduce number of calls here, but in genereal spyglass is making many queries to the database. If the latency is high enough where this is slowing you down, you'll likely be aware of it a bunch of other spots too. It might be more productive to figure the source of the slowdown for your database queries |
Makes, sense. Okay I'll investigate what our expected latency is. I think we must be experiencing something like 200 milliseconds round-trip latency because that would be
But even at extremely good 30 msec round-trip latency this would be 2 minutes, whereas if it didn't do this 32x redundant then it would be 4 seconds. So, given that it makes a network request at every iteration, do you think this could be brought down to 128 requests instead of 128 x 32? |
Working on this solution #1125 |
I am finding that the most time-consuming part of importing a new session is the importing of all the electrodes. In my NWB there are 32 electrode groups, each with 4 electrodes, for a total of 128 electrodes. However what seems to be happening is that the 128 electrodes get inserted mayny times (maybe 32 times, once for each group?). I see
skip_duplicates=True
, so in the end only 128 electrodes are inserted. But this ends up taking > 15 minutes on my system, and it seems to be ~32 times the amount of work as it should be.Here's the code that seems to be getting executed once for every electrode group:
spyglass/src/spyglass/common/common_ephys.py
Lines 130 to 202 in 094e002
The text was updated successfully, but these errors were encountered: