Skip to content

Instantly share code, notes, and snippets.

@vireshas
Created July 5, 2018 08:51
Show Gist options
  • Save vireshas/dcb497a3f2d499134d525ef6d2f3a6e5 to your computer and use it in GitHub Desktop.
Save vireshas/dcb497a3f2d499134d525ef6d2f3a6e5 to your computer and use it in GitHub Desktop.
bad_code.clj
(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