[Haskell-beginners] Optimising a combinatorial algorithm?

Chas Leichner chas at chas.io
Thu Sep 24 16:42:45 UTC 2015


I haven't had a chance to test anything, but list operations are frequently
problematic because they make it easy to accidentally write O(n^2)
algorithms. Have you tried using Sequences or Vectors? I would expect one
of them to give you better performance for your access patterns.

On Thursday, September 24, 2015, Daniel Trstenjak <
daniel.trstenjak at gmail.com> wrote:

>
> Hi Mario,
>
> I just took a quick look on the implementation of 'dur'
> and as a first thing I would replace foldl with
> the strict version foldl'.
>
> This already might explain the memory usage.
>
> Greetings,
> Daniel
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org <javascript:;>
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20150924/43ea8aa2/attachment-0001.html>


More information about the Beginners mailing list