Skip to content

Instantly share code, notes, and snippets.

@noisesmith
Created January 2, 2016 06:04
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 noisesmith/8752dba8efde182852e4 to your computer and use it in GitHub Desktop.
Save noisesmith/8752dba8efde182852e4 to your computer and use it in GitHub Desktop.
comparing speed of making map entries from lists
user=> (crit/bench (into {} (map vec '((a 1) (b 2)))))
Evaluation count : 59832780 in 60 samples of 997213 calls.
Execution time mean : 1.021592 µs
Execution time std-deviation : 17.617726 ns
Execution time lower quantile : 990.161200 ns ( 2.5%)
Execution time upper quantile : 1.053298 µs (97.5%)
Overhead used : 1.858366 ns
nil
user=> (crit/bench (reduce #(conj % (vec %2)) {} '((a 1) (b 2))))
Evaluation count : 147289800 in 60 samples of 2454830 calls.
Execution time mean : 406.120723 ns
Execution time std-deviation : 6.871200 ns
Execution time lower quantile : 393.776136 ns ( 2.5%)
Execution time upper quantile : 420.426949 ns (97.5%)
Overhead used : 1.858366 ns
nil
user=> (crit/bench (into {} (map vec) '((a 1) (b 2))))
Evaluation count : 119331360 in 60 samples of 1988856 calls.
Execution time mean : 502.194995 ns
Execution time std-deviation : 9.020397 ns
Execution time lower quantile : 489.470212 ns ( 2.5%)
Execution time upper quantile : 520.309515 ns (97.5%)
Overhead used : 1.858366 ns
Found 1 outliers in 60 samples (1.6667 %)
low-severe 1 (1.6667 %)
Variance from outliers : 7.7728 % Variance is slightly inflated by outliers
nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment