Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@chpill
Last active March 26, 2017 00:41
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 chpill/f41a4785b6cda6806b63699fa3369e56 to your computer and use it in GitHub Desktop.
Save chpill/f41a4785b6cda6806b63699fa3369e56 to your computer and use it in GitHub Desktop.
(require '[net.cgrand.xforms :as x])
(defn using-xforms [chunks]
(into {}
(comp (halt-when error?)
cat
(x/by-key :a x/count))
chunks))
(using-xforms chunks)
=> {0 3330, 1 3330, 2 3330} ;; IT WORKS!
(criterium/quick-bench (using-xforms chunks))
"
Evaluation count : 1578 in 6 samples of 263 calls.
Execution time mean : 409.277676 µs
Execution time std-deviation : 42.914476 µs
Execution time lower quantile : 387.744354 µs ( 2.5%)
Execution time upper quantile : 482.870979 µs (97.5%)
Overhead used : 1.481300 ns
Found 1 outliers in 6 samples (16.6667 %)
low-severe 1 (16.6667 %)
Variance from outliers : 30.7015 % Variance is moderately inflated by outliers
"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment