Fork me on GitHub
#clojure-dev
<
2019-08-23
>
andy.fingerhut18:08:51

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

andy.fingerhut18:08:33

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.