Last active
August 29, 2015 14:09
-
-
Save wrobstory/398706fd4a4c3c663448 to your computer and use it in GitHub Desktop.
Cardinality
This file contains hidden or 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
;; Cardinality 10-10000, seq of 100000 integers | |
(def card10 (gen/sample (gen/choose 0 10) 100000)) | |
(def card100 (gen/sample (gen/choose 0 100) 100000)) | |
(def card1000 (gen/sample (gen/choose 0 1000) 100000)) | |
(def card10000 (gen/sample (gen/choose 0 10000) 100000)) | |
;; Create levels and an integer array representing those levels | |
user=> (time (dotimes [n 5] (def myarr (ca/make-indexed-array card10)))) | |
"Elapsed time: 1841.995 msecs" | |
nil | |
user=> (time (dotimes [n 5] (def myarr (ca/make-indexed-array card100)))) | |
"Elapsed time: 2246.822 msecs" | |
nil | |
user=> (time (dotimes [n 5] (def myarr (ca/make-indexed-array card1000)))) | |
"Elapsed time: 7051.138 msecs" | |
nil | |
user=> (time (dotimes [n 5] (def myarr (ca/make-indexed-array card10000)))) | |
"Elapsed time: 59649.677 msecs" | |
nil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment