Skip to content

Instantly share code, notes, and snippets.

@ato
Created November 1, 2009 12:38
Show Gist options
  • Save ato/223515 to your computer and use it in GitHub Desktop.
Save ato/223515 to your computer and use it in GitHub Desktop.
(def randArray
(for [y (range 100)]
(persistent!
(reduce (fn [v _] (conj! v (rand)))
(transient []) (range (* 100 1000))))))
(def sums (map #(reduce + %) randArray))
(time (dorun (map println sums)))
"Elapsed time: 4525.053846 msecs"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment