[Haskell-beginners] General Hints on Improving Performance - Example DBSCAN
mailing at heum.de
Tue Jun 19 16:45:51 CEST 2012
I'm sorry the Thread title is not very helpful... I hope this is better
> in order to tune my brain to "functional thinking" I've decided to
> start writing some "real" programs. After having spent a couple of
> days figuring out how to translate an imperative algorithm into
> stateless haskell I beleive I've now managed a simple implementation
> of the DBSCAN clustering algorithm.
> This code has several drawbacks (and probably it doesn't work
> correctly after all) but I would like to tune its performance.
> Obviously the code calls several functions multiply with the same
> arguments. Haskell, being stateless should thus always yield the same
> resuts, correct? In this case performing the same calculations
> multiply seems pointless.
> My question:
> How would you go about improving this code?
> In any imperative language I would simply cache
> distances/neighborhoods in a matrix. Obviously this is not what the
> way to go in haskell?
> Thank you very much
> Beginners mailing list
> Beginners at haskell.org
More information about the Beginners