Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
partial vs func
(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
You can’t perform that action at this time.