Merged
Conversation
By default dask traverses builtin python collections looking for dask objects passed to ``delayed``. For large collections this can be expensive. This PR adds a keyword ``traverse`` to ``delayed``, to tell dask to avoid doing this traversal. Fixes dask#1884.
mrocklin
reviewed
Jan 9, 2017
| task, dasks = to_task_dasks(obj) | ||
| else: | ||
| task = quote(obj) | ||
| dasks = [] |
Member
There was a problem hiding this comment.
I'm curious, why the need to quote?
Member
Author
There was a problem hiding this comment.
If obj is a tuple that looks like a task, or a list containing tuples that look like tasks. Looks like the second isn't handled though, will fix.
Previously `quote` would only quote tasks, and would make a copy of the tuple, as well as recurse into its arguments. Now we wrap literals in a small class, and then return a task to unbox them. This is more efficient, as it removes the need to copy and is O(1) (instead of recursing through the collection).
Member
Author
|
Should be good to go now. |
Member
Author
|
Merging soon if no comment. |
Use `__call__` instead of a separate function.
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.
By default dask traverses builtin python collections looking for dask
objects passed to
delayed. For large collections this can beexpensive. This PR adds a keyword
traversetodelayed, to telldask to avoid doing this traversal.
Fixes #1884.