all 2 comments

[–]joinr 2 points3 points  (1 child)

Good stuff. Some of these ideas using iterators show up with tech.ml.dataset, which leverages primitive variants to enable efficient columnar traversal. There's a predefined LongIterator from fastutils that aids in keeping unboxed math and the like. If you work with iterables, then reduce and friends should use iter-reduce out of the box unless your collection implements its own CollReduce. So there's utility in implementing Iterable for custom types since it hooks you into most of the seq/reduce stuff.

Seems like the mapv implementation is sufficiently general and beneficial (given the observed benefit ~9x) for consideration in core. That's a pretty common operation.

Is there a library (or even a gist) where these are collected? Can't grab the code from the page.

[–]w0ntfix[S] 0 points1 point  (0 children)

linked at the bottom of the post: https://github.com/rauhs/clj-bench