Skip to content

Instantly share code, notes, and snippets.

@cstorey
Last active December 13, 2015 20:19
Show Gist options
  • Save cstorey/4969536 to your computer and use it in GitHub Desktop.
Save cstorey/4969536 to your computer and use it in GitHub Desktop.
Clojure's rest arguments are quite fast, as it turns out:
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