Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defn using-xform--improved [chunks]
- (transduce (comp (halt-when error?)
- cat
- (x/by-key :a x/count))
- conj
- {}
- chunks))
- (using-xform--improved chunks)
- => {0 3330, 1 3330, 2 3330} ;; Still works
- (using-xform--improved mini-chunks-with-error)
- => {:error "Something terrible has happened!"} ;; Better!
- (criterium/bench (using-xform--improved chunks))
- "
- Evaluation count : 156300 in 60 samples of 2605 calls.
- Execution time mean : 405.974099 µs
- Execution time std-deviation : 21.578325 µs
- Execution time lower quantile : 377.589901 µs ( 2.5%)
- Execution time upper quantile : 448.218002 µs (97.5%)
- Overhead used : 1.481300 ns
- Found 1 outliers in 60 samples (1.6667 %)
- low-severe 1 (1.6667 %)
- Variance from outliers : 38.5251 % Variance is moderately inflated by outliers
- "
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement