Created
July 5, 2018 08:51
-
-
Save vireshas/dcb497a3f2d499134d525ef6d2f3a6e5 to your computer and use it in GitHub Desktop.
bad_code.clj
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 path ["abc" "def" "xyz" "ref" "fed"]) | |
(defn a [] | |
(->> path | |
(interpose "/") | |
(into ["/"]) | |
(apply str))) | |
(defn b [] | |
(str "/" (clojure.string/join #"/" path))) | |
(defn timer [f] | |
(let [_ (time (repeat 1000000 f))])) | |
(timer a) | |
(timer b) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment