On Mon, Aug 16, 2010 at 9:00 AM, Sebastian Fischer <
s...@informatik.uni-kiel.de> wrote:

> [CC-ing café again]
>
>
> On Aug 16, 2010, at 5:52 PM, Daniel Fischer wrote:
>
>  I am a bit concerned about the memory usage.
>>>
>>
>> Of your implementation of the matrix power algorithm?
>>
>
> Yes.
>
>  Making the fields of Matrix strict should help:
>>
>> data Matrix a = Matrix !a !a !a
>>
>
>
> Making all fields strict makes memory usage worse. When making only the
> first field strict, memory usage hardly differs (from the current
> implementation without strictness annotations).


That's interesting.  So next I would use heap profiling to find out where
and what type of data the calculation is using.  I would do heap profiling
and look at the types.  The strictness above should when there are lots of
thunks in memory for computing the values in the Matrix.

To get started at this task, I recommend the chapter on performance from
Real-World Haskell:
http://book.realworldhaskell.org/read/profiling-and-optimization.html

I'd love to hear what you learn as I probably won't have time to poke at it.

Jason
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to