Fork me on GitHub
#clojure-dev
<
2018-04-06
>
reborg11:04:23

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 http://ix.io/16T7 . LongRange and gvec seem to benefit the most.

bronsa11:04:11

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)

bronsa11:04:15

a patch is probably welcome

reborg12:04:17

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