AI
Size: a a a
AI
T
T
T
AI
ST
AI
ST
(criterium/quick-bench
(->> [1 2 3 4 5 6 7 8 9]
(filter odd?)
(map inc)))
Evaluation count : 28158930 in 6 samples of 4693155 calls.
Execution time mean : 19,731517 ns
Execution time std-deviation : 0,546683 ns
Execution time lower quantile : 19,137460 ns ( 2,5%)
Execution time upper quantile : 20,501647 ns (97,5%)
Overhead used : 1,968342 ns
=> nil
(criterium/quick-bench
(->> [1 2 3 4 5 6 7 8 9]
(keep #(when (odd? %) (inc %)))))
Evaluation count : 39137214 in 6 samples of 6522869 calls.
Execution time mean : 13,550558 ns
Execution time std-deviation : 0,375282 ns
Execution time lower quantile : 13,228330 ns ( 2,5%)
Execution time upper quantile : 14,162950 ns (97,5%)
Overhead used : 1,968342 ns
DM
AI
AI
ST
AI
AI
AI
ST
AI
ST
;; `keep` is useful with maps:
(keep {:a 1, :b 2, :c 3} [:a :b :d])
;;=> (1 2)
ST
;; `keep` is useful with maps:
(keep {:a 1, :b 2, :c 3} [:a :b :d])
;;=> (1 2)