Skip to content

Instantly share code, notes, and snippets.

@siscia
Last active December 15, 2015 01:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save siscia/5182951 to your computer and use it in GitHub Desktop.
Save siscia/5182951 to your computer and use it in GitHub Desktop.
(quick-bench (dotimes [_ 1e3] (doall (map + (take 1e4 (repeatedly #(Math/random)))
(take 1e4 (repeatedly #(Math/random)))))))
Evaluation count : 6 in 6 samples of 1 calls.
Execution time mean : 4.955435 sec
Execution time std-deviation : 60.297179 ms
Execution time lower quantile : 4.884205 sec ( 2.5%)
Execution time upper quantile : 5.017391 sec (97.5%)
nil
user> (quick-bench (dotimes [_ 1e3] (doall (pmap + (take 1e4 (repeatedly #(Math/random)))
(take 1e4 (repeatedly #(Math/random)))))))
Evaluation count : 6 in 6 samples of 1 calls.
Execution time mean : 39.231347 sec
Execution time std-deviation : 152.833164 ms
Execution time lower quantile : 39.002800 sec ( 2.5%)
Execution time upper quantile : 39.392721 sec (97.5%)
user=> (time (pmap inc [1 2 3]))
"Elapsed time: 10.830703 msecs"
(2 3 4)
user=> (time (map inc [1 2 3]))
"Elapsed time: 0.036178 msecs"
(2 3 4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment