Created
November 27, 2017 13:02
-
-
Save jiacai2050/7f3a08de9290d8810e8ef74e4dabb8e5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def dataset (interleave (range 10000000) (range))) | |
(defn workflow [ds] | |
(->> ds | |
(dedupe) | |
(map #(* % %)) | |
(filter #(= 0 (rem % 111))) | |
(take 10))) | |
(with-progress-reporting (bench (workflow dataset))) | |
;; Execution time mean : 173.265424 ns | |
;; Execution time std-deviation : 6.851563 ns | |
;; Execution time lower quantile : 164.763159 ns ( 2.5%) | |
;; Execution time upper quantile : 187.295385 ns (97.5%) | |
;; Overhead used : 1.964161 ns | |
(def workflow2 | |
(comp | |
(dedupe) | |
(map #(* % %)) | |
(filter #(= 0 (rem % 111))) | |
(take 10))) | |
(with-progress-reporting (bench (sequence workflow2 dataset))) | |
;; Evaluation count : 273778620 in 60 samples of 4562977 calls. | |
;; Execution time mean : 215.319869 ns | |
;; Execution time std-deviation : 3.715614 ns | |
;; Execution time lower quantile : 209.969636 ns ( 2.5%) | |
;; Execution time upper quantile : 221.657620 ns (97.5%) | |
;; Overhead used : 1.964161 ns |
Author
jiacai2050
commented
Nov 27, 2017
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment