Skip to content
Snippets Groups Projects
Unverified Commit be2398bc authored by David Feuer's avatar David Feuer Committed by GitHub
Browse files

Chunk better (#45)


`parListChunk` previously split a list up into chunks, applied
the given strategy to each chunk, and then put them all together
again. This led to two extra copies of the list.

We get very little benefit from actually splitting the list, because the
parallel computations need to traverse their part anyway; we can instead just
hand off the whole list and let them count out their chunk.  We count each
chunk twice, but that shouldn't cost enough to matter.

Now that `Eval` has a `MonadFix` instance, we can avoid actually having
to put together lists at the end; instead, we pass each parallel
computation the (as-yet-uncomputed) result of calculating the rest
of the list.

---------

Co-authored-by: default avatarkonsumlamm <44230978+konsumlamm@users.noreply.github.com>
parent 350e5133
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment