Skip to content

Instantly share code, notes, and snippets.

@alexnixon
Created August 22, 2012 15:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexnixon/73878a2fec73a6a3dbb4 to your computer and use it in GitHub Desktop.
Save alexnixon/73878a2fec73a6a3dbb4 to your computer and use it in GitHub Desktop.
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