Fork me on GitHub

Not sure how interesting this is, but chunked sequential processing (as implemented by map, map-indexed, keep, keep-indexed, filter with dotimes) can be improved by using .reduce on the ArrayChunk. Some benchmarks . LongRange and gvec seem to benefit the most.


nice, that’s not too surprising as the reduce impl can skip the bound checks that a loop with nth can’t (+ the java loop uses integer arithmetic which I assume is marginally faster than long arithmetic, but probably not as significant as the lack of bounds check)


a patch is probably welcome


sure, I can do that, just wanted to verify it has some sense