Skip to content

Instantly share code, notes, and snippets.

@jmhdez
Created November 14, 2014 15:03
Show Gist options
  • Save jmhdez/46de62a0520bd0c8081b to your computer and use it in GitHub Desktop.
Save jmhdez/46de62a0520bd0c8081b to your computer and use it in GitHub Desktop.
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