clojure-dev

Issues: https://clojure.atlassian.net/browse/CLJ | Guide: https://insideclojure.org/2015/05/01/contributing-clojure/
ghadi 2019-08-25T03:48:27.005600Z

https://bugs.openjdk.java.net/browse/JDK-8223051 @andy.fingerhut HotSpot doesn't currently perform useful optimizations on loops with a long trip count

jumar 2019-08-25T04:22:40.005800Z

That's a good point but I don't see how this explains the observed performance difference. Isn't the loop variable long in both cases (as Andy observed)?

2019-08-25T04:40:41.006Z

Yeah, I do not think that fact fully explains what is going on. I have hacked Clojure to allow an int primitive loop variable, and JIT can compile it to even slower code than the first iteration faster version with a long (but still faster than the 2nd and later iterations)