It's usually desirable to have chunk sizes as similar as possible. If we simply divide the array by the number of threads, sometimes the last chunk can turn out to have a very different size from the others. By changing the way we compute the indices, dividing by the number of arrays after we multiply by the chunk index, we ensure chunk sizes differ at most by 1.
Hi @nlw0 thanks for writing this, there is no future work happening on this version of the repository, all PRs and such should be directed to the new head at https://github.com/JuliaFolds2/Transducers.jl
It's usually desirable to have chunk sizes as similar as possible. If we simply divide the array by the number of threads, sometimes the last chunk can turn out to have a very different size from the others. By changing the way we compute the indices, dividing by the number of arrays after we multiply by the chunk index, we ensure chunk sizes differ at most by 1.