Skip to content

Instantly share code, notes, and snippets.

@siscia
Created March 17, 2013 15:19
Show Gist options
  • Save siscia/5181990 to your computer and use it in GitHub Desktop.
Save siscia/5181990 to your computer and use it in GitHub Desktop.
user> (use 'parallel-colt-matrix.matrix)
nil
user> (use 'criterium.core)
nil
user> (use 'clojure.core.matrix.protocols)
nil
user> (let [a (get-matrix (vec (partition 10 (take 1e1 (repeatedly #(Math/random))))))
b (get-matrix (vec (partition 10 (take 1e1 (repeatedly #(Math/random))))))]
(quick-bench (dotimes [i 1e3] (matrix-add a b))))
WARNING: Final GC required 20.85847607060592 % of runtime
Evaluation count : 7002 in 6 samples of 1167 calls.
Execution time mean : 87.039488 us
Execution time std-deviation : 6.459939 us
Execution time lower quantile : 81.698661 us ( 2.5%)
Execution time upper quantile : 94.574135 us (97.5%)
nil
user> (let [a (get-matrix (vec (partition 10 (take 1e2 (repeatedly #(Math/random))))))
b (get-matrix (vec (partition 10 (take 1e2 (repeatedly #(Math/random))))))]
(quick-bench (dotimes [i 1e3] (matrix-add a b))))
WARNING: Final GC required 21.43588188939682 % of runtime
Evaluation count : 1398 in 6 samples of 233 calls.
Execution time mean : 453.317811 us
Execution time std-deviation : 28.264275 us
Execution time lower quantile : 418.532687 us ( 2.5%)
Execution time upper quantile : 483.815515 us (97.5%)
nil
user> (let [a (get-matrix (vec (partition 10 (take 1e3 (repeatedly #(Math/random))))))
b (get-matrix (vec (partition 10 (take 1e3 (repeatedly #(Math/random))))))]
(quick-bench (dotimes [i 1e3] (matrix-add a b))))
WARNING: Final GC required 20.625509885117648 % of runtime
Evaluation count : 150 in 6 samples of 25 calls.
Execution time mean : 4.267180 ms
Execution time std-deviation : 99.569231 us
Execution time lower quantile : 4.141206 ms ( 2.5%)
Execution time upper quantile : 4.388118 ms (97.5%)
nil
user> (let [a (get-matrix (vec (partition 10 (take 1e4 (repeatedly #(Math/random))))))
b (get-matrix (vec (partition 10 (take 1e4 (repeatedly #(Math/random))))))]
(quick-bench (dotimes [i 1e3] (matrix-add a b))))
WARNING: Final GC required 22.40667114108057 % of runtime
Evaluation count : 12 in 6 samples of 2 calls.
Execution time mean : 48.680351 ms
Execution time std-deviation : 2.840909 ms
Execution time lower quantile : 46.097983 ms ( 2.5%)
Execution time upper quantile : 52.359677 ms (97.5%)
nil
user> (let [a (get-matrix (vec (partition 10 (take 1e5 (repeatedly #(Math/random))))))
b (get-matrix (vec (partition 10 (take 1e5 (repeatedly #(Math/random))))))]
(quick-bench (dotimes [i 1e3] (matrix-add a b))))
WARNING: Final GC required 3.069206803605759 % of runtime
Evaluation count : 6 in 6 samples of 1 calls.
Execution time mean : 765.866221 ms
Execution time std-deviation : 24.272420 ms
Execution time lower quantile : 717.859918 ms ( 2.5%)
Execution time upper quantile : 782.468402 ms (97.5%)
Found 1 outliers in 6 samples (16.6667 %)
low-severe 1 (16.6667 %)
Variance from outliers : 13.8889 % Variance is moderately inflated by outliers
nil
user> (let [a (get-matrix (vec (partition 10 (take 1e6 (repeatedly #(Math/random))))))
b (get-matrix (vec (partition 10 (take 1e6 (repeatedly #(Math/random))))))]
(quick-bench (dotimes [i 1e3] (matrix-add a b))))
Evaluation count : 6 in 6 samples of 1 calls.
Execution time mean : 6.269815 sec
Execution time std-deviation : 301.480507 ms
Execution time lower quantile : 6.061730 sec ( 2.5%)
Execution time upper quantile : 6.675544 sec (97.5%)
nil
;;; Using mutability
parallel-colt-matrix.matrix> (let [a (get-matrix (vec (partition 10 (take 1e1 (repeatedly #(Math/random))))))
b (get-matrix (vec (partition 10 (take 1e1 (repeatedly #(Math/random))))))]
(quick-bench (dotimes [i 1e3] (matrix-add! a b))))
WARNING: Final GC required 21.48275358130799 % of runtime
Evaluation count : 14652 in 6 samples of 2442 calls.
Execution time mean : 43.144480 us
Execution time std-deviation : 869.615698 ns
Execution time lower quantile : 42.101683 us ( 2.5%)
Execution time upper quantile : 44.246095 us (97.5%)
Found 1 outliers in 6 samples (16.6667 %)
low-severe 1 (16.6667 %)
Variance from outliers : 13.8889 % Variance is moderately inflated by outliers
nil
parallel-colt-matrix.matrix> (let [a (get-matrix (vec (partition 10 (take 1e2 (repeatedly #(Math/random))))))
b (get-matrix (vec (partition 10 (take 1e2 (repeatedly #(Math/random))))))]
(quick-bench (dotimes [i 1e3] (matrix-add! a b))))
WARNING: Final GC required 21.48263139308018 % of runtime
Evaluation count : 2304 in 6 samples of 384 calls.
Execution time mean : 262.566586 us
Execution time std-deviation : 4.897571 us
Execution time lower quantile : 258.094956 us ( 2.5%)
Execution time upper quantile : 268.211163 us (97.5%)
nil
parallel-colt-matrix.matrix> (let [a (get-matrix (vec (partition 10 (take 1e3 (repeatedly #(Math/random))))))
b (get-matrix (vec (partition 10 (take 1e3 (repeatedly #(Math/random))))))]
(quick-bench (dotimes [i 1e3] (matrix-add! a b))))
WARNING: Final GC required 19.941840688090302 % of runtime
Evaluation count : 246 in 6 samples of 41 calls.
Execution time mean : 2.520621 ms
Execution time std-deviation : 58.295109 us
Execution time lower quantile : 2.461161 ms ( 2.5%)
Execution time upper quantile : 2.584803 ms (97.5%)
nil
parallel-colt-matrix.matrix> (let [a (get-matrix (vec (partition 10 (take 1e4 (repeatedly #(Math/random))))))
b (get-matrix (vec (partition 10 (take 1e4 (repeatedly #(Math/random))))))]
(quick-bench (dotimes [i 1e3] (matrix-add! a b))))
WARNING: Final GC required 16.218498639770722 % of runtime
Evaluation count : 30 in 6 samples of 5 calls.
Execution time mean : 26.798289 ms
Execution time std-deviation : 900.965377 us
Execution time lower quantile : 25.699837 ms ( 2.5%)
Execution time upper quantile : 28.173904 ms (97.5%)
Found 1 outliers in 6 samples (16.6667 %)
low-severe 1 (16.6667 %)
Variance from outliers : 13.8889 % Variance is moderately inflated by outliers
nil
parallel-colt-matrix.matrix> (let [a (get-matrix (vec (partition 10 (take 1e5 (repeatedly #(Math/random))))))
b (get-matrix (vec (partition 10 (take 1e5 (repeatedly #(Math/random))))))]
(quick-bench (dotimes [i 1e3] (matrix-add! a b))))
WARNING: Final GC required 16.04177382964409 % of runtime
Evaluation count : 6 in 6 samples of 1 calls.
Execution time mean : 230.704965 ms
Execution time std-deviation : 9.685381 ms
Execution time lower quantile : 217.531095 ms ( 2.5%)
Execution time upper quantile : 241.397430 ms (97.5%)
nil
parallel-colt-matrix.matrix> (let [a (get-matrix (vec (partition 10 (take 1e6 (repeatedly #(Math/random))))))
b (get-matrix (vec (partition 10 (take 1e6 (repeatedly #(Math/random))))))]
(quick-bench (dotimes [i 1e3] (matrix-add! a b))))
Evaluation count : 6 in 6 samples of 1 calls.
Execution time mean : 2.237656 sec
Execution time std-deviation : 93.108080 ms
Execution time lower quantile : 2.095404 sec ( 2.5%)
Execution time upper quantile : 2.343206 sec (97.5%)
nil
parallel-colt-matrix.matrix>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment