Arrays and arrays

Simon Marlow simonmar@microsoft.com
Wed, 22 Jan 2003 16:59:54 -0000


> Hal Daume III <hdaume@ISI.EDU> writes:
>=20
> [snip my functions that use the ST monad to do (//)]
>=20
> > You shouldn't try to write these functions.  You should do all array
> > modifications within the ST monad, rather than looking for a pure
> > solution.
>=20
> All right, but why?  It seems an obvious trick, take some pieces that
> benefit from imperative processing, and wrap them in ST, leaving the
> rest of the program as it were.
>=20
> Can you (or anybody else) explain the memory behaviour I see (using
> hundreds of megabytes, but only tens of K visible in the profiling
> output)?=20

That's because currently large objects aren't included in the profile.
There's no really good reason for this, except that threads (including
their stacks) count as large objects, and seeing them in the profile
might be confusing.  On the other hand, it might also be enlightening if
you have a program that uses a lot of stack space.

I'll look into fixing this.

Cheers,
	Simon