Clojure 并行程序对比

并行执行:

(def data1 (partition 10000000 (range 100000000)))
(dorun data1)
(time (reduce + (pmap #(reduce + %) data1)))

串行执行:
(def data2 (range 100000000))
(dorun data2)
(time (reduce + data2))

作者: hqiang1984

量化自我,极简主义