Created
September 3, 2014 07:34
-
-
Save mschuetz/fb98c6e1d926ed4a589d to your computer and use it in GitHub Desktop.
clojure call performance
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
(ns funcall_perf) | |
(defn len1a [^String foo] (.length foo)) | |
(defn len1b [foo] (.length foo)) | |
(defn len2a [^String foo] (count foo)) | |
(defn len2b [foo] (count foo)) | |
; warm up | |
(doseq [func [len1a len1b len2a len2b]] | |
(dotimes [n 1000000] | |
(func "asdf"))) | |
(doseq [func [len1a len1b len2a len2b]] | |
(time | |
(dotimes [n 1000000] | |
(func "asdf")))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment