Created
November 14, 2014 15:03
-
-
Save jmhdez/46de62a0520bd0c8081b to your computer and use it in GitHub Desktop.
partial vs func
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
(def double-partial (partial * 2)) | |
(defn double-fn [x] (* 2 x)) | |
(time | |
(dotimes [n 10000000] | |
(double-partial 5))) | |
;; => "Elapsed time: 3139.323652 msecs" | |
(time | |
(dotimes [n 10000000] | |
(double-fn 5))) | |
;; => "Elapsed time: 489.968137 msecs" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment