-
-
Save alexnixon/73878a2fec73a6a3dbb4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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