This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-12-26
Channels
- # adventofcode (15)
- # beginners (7)
- # cider (2)
- # clojure (42)
- # clojure-austin (1)
- # clojure-europe (4)
- # clojure-nl (2)
- # clojurescript (19)
- # core-typed (1)
- # cursive (1)
- # datomic (10)
- # fulcro (30)
- # graphql (8)
- # hoplon (28)
- # hyperfiddle (16)
- # jobs (1)
- # off-topic (2)
- # philosophy (1)
- # re-frame (1)
- # shadow-cljs (30)
- # vim (3)
(defn distance [[x0 y0 z0] [x1 y1 z1]]
(+ (Math/abs (- x0 x1))
(Math/abs (- y0 y1))
(Math/abs (- z0 z1))))
"Elapsed time: 9046.938164 msecs"
(defn distance [[x0 y0 z0] [x1 y1 z1]]
(+ (Math/abs ^long (- x0 x1))
(Math/abs ^long (- y0 y1))
(Math/abs ^long (- z0 z1))))
"Elapsed time: 291.773856 msecs"

Yep, I've learned to turn on reflection warnings so I can fix ones in the critical path. I know CIDER will point them out when it's enabled, other tools might as well
I learned this lesson with ^Character on day 5: https://github.com/thegeez/clj-advent-of-code-2018/blob/master/src/advent2018/core.clj#L389
@U06D9RGQM woah, you don't mess around with namespaces
This was day25 where there’s a 4th dimensions and the numbers were low. I guess long is probably better in general, and spliting out the operations would also give a speed up
was optimizing and cleaning up arjun
s 23-2 solution here and there:
https://github.com/arjun27/advent-of-code-clojure/blob/master/src/advent/2018/day23.clj
https://github.com/akovantsev/adventofcode/blob/master/src/adventofcode/2018/day23_2.clj