Clojure

transducer arities for map-indexed, distinct, and interpose

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: Release 1.7
  • Component/s: None
  • Labels:
  • Patch:
    Code and Test
  • Approval:
    Ok

Description

  • with generative tests
  • with examples demonstrating performance

Performance: Details in comments, summary:

(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 CLJ-700 (which is not currently in 1.7). I have a new patch and direction on CLJ-700 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 CLJ-700 does go in.

Screened by:

  1. clj-1601.patch
    25/Nov/14 4:22 PM
    5 kB
    Alex Miller
  2. clj-1601-2.patch
    25/Nov/14 4:59 PM
    8 kB
    Alex Miller
  3. clj-1601-3.patch
    17/Dec/14 1:50 PM
    8 kB
    Alex Miller
  4. clj-1601-4.patch
    09/Jan/15 10:27 AM
    8 kB
    Alex Miller
  5. clj-1601-transient-distinct.patch
    21/Dec/14 6:13 AM
    2 kB
    Nikita Prokopov

Activity

Stuart Halloway made changes -
Field Original Value New Value
Assignee Alex Miller [ alexmiller ]
Approval Vetted [ 10003 ]
Fix Version/s Release 1.7 [ 10250 ]
Alex Miller made changes -
Labels transducers
Attachment clj-1601.patch [ 13546 ]
Patch Code [ 10001 ]
Alex Miller made changes -
Attachment clj-1601-2.patch [ 13547 ]
Description * with generative tests
* with examples demonstrating performance
* with generative tests
* with examples demonstrating performance

*Patch:* clj-1601-2.patch

*Screened by:*
Patch Code [ 10001 ] Code and Test [ 10002 ]
Alex Miller made changes -
Description * with generative tests
* with examples demonstrating performance

*Patch:* clj-1601-2.patch

*Screened by:*
* with generative tests
* with examples demonstrating performance

*Performance:* Details in comments, summary:
{code}
(def v (vec (concat (range 1000) (range 1000))))
(into [] (distinct v)) ;; 821.339608 µs
(into [] (distinct) v) ;; 43.630656 µs
(into [] (interpose nil v)) ;; 316.024853 µs
(into [] (interpose nil) v) ;; 35.592672 µs
(into [] (map-indexed vector v)) ;; 76.807691 µs
(into [] (map-indexed vector) v) ;; 49.458043 µs
{code}

*Patch:* clj-1601-2.patch

*Screened by:*
Alex Miller made changes -
Approval Vetted [ 10003 ] Incomplete [ 10006 ]
Alex Miller made changes -
Attachment clj-1601-3.patch [ 13634 ]
Description * with generative tests
* with examples demonstrating performance

*Performance:* Details in comments, summary:
{code}
(def v (vec (concat (range 1000) (range 1000))))
(into [] (distinct v)) ;; 821.339608 µs
(into [] (distinct) v) ;; 43.630656 µs
(into [] (interpose nil v)) ;; 316.024853 µs
(into [] (interpose nil) v) ;; 35.592672 µs
(into [] (map-indexed vector v)) ;; 76.807691 µs
(into [] (map-indexed vector) v) ;; 49.458043 µs
{code}

*Patch:* clj-1601-2.patch

*Screened by:*
* with generative tests
* with examples demonstrating performance

*Performance:* Details in comments, summary:
{code}
(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
{code}

*Patch:* clj-1601-3.patch

*Screened by:*
Approval Incomplete [ 10006 ] Vetted [ 10003 ]
Nikita Prokopov made changes -
Attachment clj-1601-transient-distinct.patch [ 13654 ]
Alex Miller made changes -
Description * with generative tests
* with examples demonstrating performance

*Performance:* Details in comments, summary:
{code}
(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
{code}

*Patch:* clj-1601-3.patch

*Screened by:*
* with generative tests
* with examples demonstrating performance

*Performance:* Details in comments, summary:
{code}
(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
{code}

*Patch:* clj-1601-3.patch

*Screening note:* We could use transients to improve performance of the distinct impl, except checking containment in a transient set is broken per CLJ-700 (which is not currently in 1.7). I have a new patch and direction on CLJ-700 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 CLJ-700 does go in.

*Screened by:*
Stuart Halloway made changes -
Approval Vetted [ 10003 ] Screened [ 10004 ]
Rich Hickey made changes -
Approval Screened [ 10004 ] Ok [ 10007 ]
Alex Miller made changes -
Attachment clj-1601-4.patch [ 13740 ]
Description * with generative tests
* with examples demonstrating performance

*Performance:* Details in comments, summary:
{code}
(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
{code}

*Patch:* clj-1601-3.patch

*Screening note:* We could use transients to improve performance of the distinct impl, except checking containment in a transient set is broken per CLJ-700 (which is not currently in 1.7). I have a new patch and direction on CLJ-700 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 CLJ-700 does go in.

*Screened by:*
* with generative tests
* with examples demonstrating performance

*Performance:* Details in comments, summary:
{code}
(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
{code}

*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 CLJ-700 (which is not currently in 1.7). I have a new patch and direction on CLJ-700 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 CLJ-700 does go in.

*Screened by:*
Stuart Halloway made changes -
Status Open [ 1 ] Closed [ 6 ]
Resolution Completed [ 1 ]

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: