Avoid unnecessary __getitem__ in block() when chunks have correct dimensionality#5884
Merged
mrocklin merged 1 commit intodask:masterfrom Feb 12, 2020
Merged
Conversation
…ensionality, which improves performance significantly in that case.
Member
|
This looks great to me. Thanks @astrofrog ! Merging. Also, I notice that this is your first code contribution to this repository. Welcome! I'm also personally excited to see you using Dask enough to find bugs. I hope that the project is proving useful to you all in astronomy-land. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This improves performance in
block()by almost a factor of 2 when chunks have the same dimensionality as the final array. Here is an example:Before this patch:
After this patch:
I haven't added any specific tests since both cases (same and different dimensionality) are likely already covered by the test suite, and this is just a performance improvement.
black dask/flake8 dask