Created
November 14, 2014 15:03
partial vs func
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
(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