3 ms·
I just noticed you can actually leverage `into-array` at critical parts - if you just need a data collection for quick traversal.
by geokon 5y ago
I just noticed you can actually leverage `into-array` at critical parts - if you just need a data collection for quick traversal.
- didibus 5y agoIf you're interested in high-performance Clojure, these articles are good: https://dragan.rocks/articles/18/Fluokitten-070-map-reduce-primitive-arrays-without-macros https://dragan.rocks/articles/18/Fluokitten-070-map-reduce-p... Fluokitten and Neanderthal are great for high performance numerics. Can't really get any faster than Neanderthal (which uses MKL and the GPU for compute). And fluokitten can make working with arrays a bit nicer, in that it'll look a bit more like working with sequences, though you still need to be careful about the functions you use with it to avoid boxing. https://clojure.org/reference/java_interop https://clojure.org/reference/java_interop Read the section about type hints and working with primitive types and the optimization tips section.
- geokon 5y agooh woah very cool! sorry for the late response - I wanted to take the time to look at it more closely. Thanks for that info. I'd never really looked into Fluokitten. It looks awesome :D I've played with Neanderthal but the MKL dependency is a bit annoying (doesn't work on my Pinebook Pro and I can't ship binaries with it) - so I'd overlooked Fluokitten entirely. But this is very complementary to the Clojury way of doing stuff and has no dependencies. I'm def going to try to work this into my standard toolbox :)) I've only done the normal java-interop stuff in the past but this looks like a definite step up