Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Override reduceUnordered in Task's Nondeterminism
Previously we were overriding gatherUnordered which was not actually called when Task.gatherUnordered was called with its default argument. Instead chooseAny was being called, which gave very poor performance: val start = System.currentTimeMillis Task.gatherUnordered((1 to 1000).map(Task.now)).unsafePerformSync println(System.currentTimeMillis - start) For me, the above code before this change gives 563ms. After this change gives 2ms. This also makes the underlying Task code consistent with Future. When we call Task.gatherUnordered, we're now pretty much calling the equivalent of Future.gatherUnordered. We should also figure out why Future's chooseAny is very slow, or if chooseAny is even useful.
- Loading branch information