Created
December 7, 2011 22:16
-
-
Save gtrak/1444977 to your computer and use it in GitHub Desktop.
atoms speed
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=> (time (let [_count (atom 0)] | |
(dotimes [a 10000000] (swap! _count inc)))) | |
"Elapsed time: 1292.590795 msecs" | |
nil | |
user=> (time (let [] | |
(dotimes [a 10000000] (inc a)))) | |
"Elapsed time: 81.46009 msecs" | |
nil | |
user=> (time (let [] | |
(dotimes [a 10000000] nil))) | |
"Elapsed time: 20.368163 msecs" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment