Last active
December 13, 2015 20:19
-
-
Save cstorey/4969536 to your computer and use it in GitHub Desktop.
Clojure's rest arguments are quite fast, as it turns out:
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=> (doseq [f [(fn [& r] r) list vector]] (time (dotimes [_ 10000000] (f 1 2)))) | |
"Elapsed time: 89.534 msecs" | |
"Elapsed time: 1619.788 msecs" | |
"Elapsed time: 659.573 msecs" | |
nil | |
user=> (doseq [f [(fn [& r] r) list vector]] (time (dotimes [_ 100000000] (f 1 2)))) | |
"Elapsed time: 284.97 msecs" | |
"Elapsed time: 16061.555 msecs" | |
"Elapsed time: 6207.421 msecs" | |
nil | |
user=> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment