4 ms·
Most of my functional programming experience is with Clojure, and it's not very deep experience, so take this with a grain of salt. However I think reasoning ab
by spacemanaki 14y ago
Most of my functional programming experience is with Clojure, and it's not very deep experience, so take this with a grain of salt. However I think reasoning about performance in Clojure isn't tremendously different than reasoning about performance in Java, and in some cases it might even be easier. Yes, it's true that you might have to learn some new idioms, like passing accumulators to tail recursive calls. But once you start structuring programs primarily as a collection of pure functions that operate on data structures like vectors and maps, I think profiling those functions is easier much in the same way that testing them can be easier. Obviously, depending on the language, you might have to develop new mental models for how to use certain features performantly (like lazy seqs and persistent collections in Clojure), but that's mostly true of any new language or even a new library.