We're updating the issue view to help you get more done. 

transducer arities for map-indexed, distinct, and interpose

Description

  • with generative tests

  • with examples demonstrating performance

Performance: Details in comments, summary:

1 2 3 4 5 6 7 (def v (vec (concat (range 1000) (range 1000)))) (into [] (distinct v)) ;; 821.3 µs (into [] (distinct) v) ;; 388.2 µs (into [] (interpose nil v)) ;; 316.0 µs (into [] (interpose nil) v) ;; 35.5 µs (into [] (map-indexed vector v)) ;; 76.8 µs (into [] (map-indexed vector) v) ;; 49.4 µs

Patch: clj-1601-4.patch

Screening note: We could use transients to improve performance of the distinct impl, except checking containment in a transient set is broken per (which is not currently in 1.7). I have a new patch and direction on that could provide a way to solve that if we want to move it back and push this further. Or we could just wait and refactor when does go in.

Screened by:

Environment

None

Status

Assignee

Alex Miller

Reporter

Stuart Halloway

Labels

Approval

Ok

Patch

Code and Test

Fix versions

Priority

Major