Skip to content

Instantly share code, notes, and snippets.

View GR-John's full-sized avatar

John Newman GR-John

View GitHub Profile
@GR-John
GR-John / slide-perf.clj
Created October 5, 2021 05:40 — forked from bsless/slide-perf.clj
Idiomatically refactor Clojure code to improve performance
;; http://johnj.com/from-elegance-to-speed.html
(def times (iterate #(+ % (rand-int 1000)) 0))
(def times-v (into [] (take 1e6) (iterate #(+ % (rand-int 1000)) 0)))
(defn smt-8 [times]
(->> times
(partition 8 1)
(map (juxt identity