This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-08-23
Channels
- # announcements (6)
- # beginners (54)
- # calva (9)
- # cider (2)
- # clj-kondo (26)
- # cljsrn (2)
- # clojure (49)
- # clojure-brasil (1)
- # clojure-dev (3)
- # clojure-europe (11)
- # clojure-italy (28)
- # clojure-nl (5)
- # clojure-serbia (1)
- # clojure-spec (4)
- # clojure-uk (182)
- # clojuredesign-podcast (2)
- # clojurescript (59)
- # clojurex (9)
- # cursive (26)
- # data-science (11)
- # datomic (40)
- # duct (1)
- # emacs (3)
- # events (4)
- # figwheel-main (2)
- # fulcro (7)
- # instaparse (1)
- # kaocha (2)
- # leiningen (25)
- # off-topic (3)
- # re-frame (36)
- # reagent (15)
- # shadow-cljs (87)
- # spacemacs (12)
- # sql (20)
- # tools-deps (8)
- # vim (1)
- # yada (40)
I have enhanced my scripts at the repo I linked before so that some of them print out JVM byte code disassembled listings for the original foo2 function, and the variations that cgrand gave earlier in this channel. I noticed in the JVM byte code that while (let [n (int n)]
caused the local n
to use a Java int
primitive value, the Clojure compiler still chose to use a long
primitive for the loop local i
created from (loop [i (int 0)]
: https://clojure.org/reference/java_interop#primitives
https://github.com/jafingerhut/leeuwenhoek for the updated repo contents.
I do not necessarily think that is the root cause of the performance weirdness -- just something I noticed and thought I would mention here in case it was unexpected.