Skip to content

Instantly share code, notes, and snippets.

@ak1t0
Last active August 29, 2015 14:08
Show Gist options
  • Save ak1t0/e6c635752b68b8d2b1d3 to your computer and use it in GitHub Desktop.
Save ak1t0/e6c635752b68b8d2b1d3 to your computer and use it in GitHub Desktop.
ReducersをCriteriumで
(ns reduce-sample.core
  (:require
   [clojure.core.reducers :as r]
   [criterium.core :as crite]))
(crite/bench (do (into [] (r/filter even? (range 100000))) nil))
Evaluation count : 4800 in 60 samples of 80 calls.
             Execution time mean : 12.794080 ms
    Execution time std-deviation : 499.778969 µs
   Execution time lower quantile : 12.532091 ms ( 2.5%)
   Execution time upper quantile : 14.625447 ms (97.5%)
                   Overhead used : 13.380751 ns
(crite/bench (do (into [] (filter even? (range 100000))) nil))
 Evaluation count : 4080 in 60 samples of 68 calls.
             Execution time mean : 14.847640 ms
    Execution time std-deviation : 128.957171 µs
   Execution time lower quantile : 14.573134 ms ( 2.5%)
   Execution time upper quantile : 15.036246 ms (97.5%)
                   Overhead used : 13.380751 ns
(crite/bench (r/fold + (into [] (r/filter even? (range 100000)))))
Evaluation count : 3540 in 60 samples of 59 calls.
             Execution time mean : 15.758254 ms
    Execution time std-deviation : 581.417097 µs
   Execution time lower quantile : 15.168734 ms ( 2.5%)
   Execution time upper quantile : 16.978078 ms (97.5%)
                   Overhead used : 13.380751 ns
(crite/bench (reduce + (into [] (filter even? (range 100000)))))
Evaluation count : 3540 in 60 samples of 59 calls.
             Execution time mean : 17.453968 ms
    Execution time std-deviation : 175.866396 µs
   Execution time lower quantile : 17.136869 ms ( 2.5%)
   Execution time upper quantile : 17.760509 ms (97.5%)
                   Overhead used : 13.380751 ns
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment