[Haskell-cafe] Profiling CAFs (re-post)
Jason Dagit
dagit at eecs.oregonstate.edu
Tue Oct 10 13:35:04 EDT 2006
On 10/10/06, Ian Lynagh <igloo at earth.li> wrote:
> On Tue, Oct 10, 2006 at 01:31:58PM +0200, Matthias Fischmann wrote:
> >
> > What qualifies as constant applicable form, and why is it not
> > labelled in a more informative way?
>
> CAFs are, AIUI, things that are just values (i.e. things that don't take
> an argument) that have been floated up to the top level.
Actually, I don't know if this is a ghc bug but I was profiling last
week and a majority of the time/allocation was done in a CAF in a
module which didn't seem to be doing much work. Turned out in my
case that the module in question imported a function from another
package which was doing a tremendous amount of work. It wasn't until
I used -caf-all that I could see the real culprit. So, I guess a CAF
can also be a function in a library you're using. And I say function
here because the work horse definetly was not a CAF. It was hPutXml
from HaXml.
The lesson for me was that -caf-all is handy to know about.
Jason
More information about the Haskell-Cafe
mailing list