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

Fix performance issue for aggregate_channels #2736

Merged
merged 1 commit into from
Apr 19, 2024

Conversation

alejoe91
Copy link
Member

Fixes #2625

@alejoe91 alejoe91 added core Changes to core module performance Performance issues/improvements labels Apr 19, 2024
@alejoe91 alejoe91 requested a review from zm711 April 19, 2024 09:22
Copy link
Collaborator

@zm711 zm711 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Just a couple quick questions, but if you want to ignore them let me know and I can just approve it and we can think about them later. See my comment about the channel_indices=None.

My second question is in the else statement we iterate through all the segments (L158), but if we are using the recording_id above wouldn't it make sense that even if the user supplies channels we make sure those channels are in that segment or does that not generate a big enough slowdown to check?

The actual changes in this PR make sense though. We just collect up all the channels we need and make one pass rather than go channel-by-channel.

@alejoe91
Copy link
Member Author

My second question is in the else statement we iterate through all the segments (L158), but if we are using the recording_id above wouldn't it make sense that even if the user supplies channels we make sure those channels are in that segment or does that not generate a big enough slowdown to check?

Yes this can be a bit misleading! In the else statement we just grab all channels because we check previously that we need to return all of them in the correct order, so no need to use the mapping.

Copy link
Collaborator

@zm711 zm711 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. Looks good to me then.

@alejoe91 alejoe91 merged commit a823e15 into SpikeInterface:main Apr 19, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Changes to core module performance Performance issues/improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sorting takes extremely long when sorting a four shank probe by property
2 participants