Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
user=> (def nums (int-array (take 10000000 (repeatedly #(rand-int 10000000)))))
#'user/nums
user=> (time (last (sort nums)))
"Elapsed time: 22885.585904 msecs"
9999998
user=> (time (last (let [r nums] (java.util.Arrays/sort r) r)))
"Elapsed time: 2586.003113 msecs"
9999998
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.