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

Optionally skip deepcopy in from_dataset methods #207

Merged
merged 5 commits into from
Dec 5, 2022

Conversation

CPBridge
Copy link
Collaborator

Tweaked all from_dataset methods to accept a new boolean copy parameter (default True) in order to skip the copy operation to improve performance. If False, the dataset parameter is altered in place. This is now used in the segread method, and dramatically improves the performance there.

@pieper this should cut around 25% off your large seg benchmark time based on my testing

@CPBridge
Copy link
Collaborator Author

Note also, there were previously a bunch of _from_dataset methods that did this but did not expose it publicly. In these cases I have essentially kept the same behaviour but now made it public via the copy parameter to the public from_dataset method. The result is a consistent API for all from_dataset methods in the library

@CPBridge CPBridge merged commit e305851 into master Dec 5, 2022
@hackermd hackermd deleted the reduce_from_dataset_copy branch December 6, 2022 01:27
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

Successfully merging this pull request may close these issues.

2 participants