[Haskell-beginners] Memory usage prediction

Patrick Mylund Nielsen haskell at patrickmylund.com
Wed Jul 3 21:20:21 CEST 2013


The short answer is no. This is Haskell's biggest weakness: it's difficult
to predict space usage.

The longer answer is "kind of" -- you can't exactly intuit it, but the
profiler is easy to use:

http://book.realworldhaskell.org/read/profiling-and-optimization.html
http://www.haskell.org/ghc/docs/7.6.2/html/users_guide/prof-heap.html

The only caveat is you have to reinstall your libraries with profiling
enabled:
http://stackoverflow.com/questions/1704421/cabal-not-installing-dependencies-when-needing-profiling-libraries

(If I've already installed some packages, usually I take the quick and
dirty route and just set library-profiling to True, delete ~/.ghc to clear
the package list, then install my package.)


On Wed, Jul 3, 2013 at 3:14 PM, Emanuel Koczwara
<poczta at emanuelkoczwara.pl>wrote:

> Hi,
>
>   Where can I find some informations abut memory usage prediction? In C
> (or C++) while I write code I can predict how much stack space will be
> used, how much heap space will be used, I can count instructions. I want
> to see all these things while I'm looking at my code. Is it possible in
> Haskell?
>
> Best regards,
> Emanuel
>
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20130703/c786f040/attachment.htm>


More information about the Beginners mailing list