(->list coll)
Efficient thread-first friendly concrete list creation.
(apply list (range 1000)) => 40.8 µs (apply list (vec (range 1000))) => 43.8 µs
(->list (range 1000)) => 28.5 µs (->list (vec (range 1000))) => 15.2 µs
Efficient thread-first friendly concrete list creation. (apply list (range 1000)) => 40.8 µs (apply list (vec (range 1000))) => 43.8 µs (->list (range 1000)) => 28.5 µs (->list (vec (range 1000))) => 15.2 µs
(mapv* f coll)
Efficient version of mapv which operates directly on the sequence instead of Clojure's reduce abstraction.
(into [] (map inc) nil) => 75 ns (into [] (map inc) (range 1000)) => 17 us (into [] (map inc) (vec (range 1000))) => 17 us
(mapv inc nil) => 70 ns (mapv inc (range 1000)) => 21 us (mapv inc (vec (range 1000))) => 19 us
(mapv* inc nil) => 3 ns (mapv* inc (range 1000)) => 22 us (mapv* inc (vec (range 1000))) => 19 us
Efficient version of mapv which operates directly on the sequence instead of Clojure's reduce abstraction. (into [] (map inc) nil) => 75 ns (into [] (map inc) (range 1000)) => 17 us (into [] (map inc) (vec (range 1000))) => 17 us (mapv inc nil) => 70 ns (mapv inc (range 1000)) => 21 us (mapv inc (vec (range 1000))) => 19 us (mapv* inc nil) => 3 ns (mapv* inc (range 1000)) => 22 us (mapv* inc (vec (range 1000))) => 19 us
(pmap* f coll)
Efficient version of pmap which avoids the overhead of lazy-seq.
(doall (pmap (fn [_] (Thread/sleep 100)) coll)) => 3.34 secs (pmap* (fn [_] (Thread/sleep 100)) coll) => 202 ms
Efficient version of pmap which avoids the overhead of lazy-seq. (doall (pmap (fn [_] (Thread/sleep 100)) coll)) => 3.34 secs (pmap* (fn [_] (Thread/sleep 100)) coll) => 202 ms
(postwalk* f form)
More efficient and meta-preserving clojure.walk/postwalk. Only handles types returned from simple-type. All ISeqs return concrete lists.
(clojure.walk/postwalk identity big-map) => 72 us (postwalk* identity big-map) => 25 us
More efficient and meta-preserving clojure.walk/postwalk. Only handles types returned from simple-type. All ISeqs return concrete lists. (clojure.walk/postwalk identity big-map) => 72 us (postwalk* identity big-map) => 25 us
(run!* f coll)
Efficient version of run! which operates directly on the sequence
instead of Clojure's reduce abstraction. Does not respond to reduced
.
(run! inc (range 1000)) => 7 µs (run!* inc (range 1000)) => 950 ns
Efficient version of run! which operates directly on the sequence instead of Clojure's reduce abstraction. Does not respond to `reduced`. (run! inc (range 1000)) => 7 µs (run!* inc (range 1000)) => 950 ns
(walk* form inner outer)
Protocol version of postwalk
Protocol version of postwalk
(with-meta* obj meta)
Same as clojure.core/with-meta except it doesn't error if the obj doesn't support meta.
Same as clojure.core/with-meta except it doesn't error if the obj doesn't support meta.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close