Fork me on GitHub

Do any of you guys know if there’s a great article about novice java interop mistakes Clojure devs do (or general things to look for)? Migrated some code from java to java interop but my performance went down by like 10%


Add (set! *warn-on-reflection* true) to each Clojure file just after the ns form. Reflection is the most likely cause of your performance issues.


If you get reflection warnings, you should be able to add type hints to the code at those points to get rid of the warning and speed your code up @davidginzbourg


Unfortunately that’s not that @seancorfield

Ben Sless18:10:16

Also, if you're doing some number crunching make sure to turn on boxed math warnings, the difference in performance can be two orders of magnitude


I think it’s something with the way I built the loop

Ben Sless18:10:34

Are you traversing a sequence or incrementing numbers?


Also for some reason using transient, assoc!, and persisten! for some reason degraded the performance as well 😢

Ben Sless18:10:09

I think you can swap not= with (not (identical? ,,,))

Ben Sless18:10:16

you'll get some speed back

🙌 3