Now that ghc 4.08 has a time profiler, I've been improving a program I wrote over the last year. However now the GC time dominates the execution time (>60%). I can see that my program is not being lazy, but I have no idea why. How can I use profiling (or any other means) to determine where my program is not being sufficiently lazy? Are there papers on such things I could read? Sengan
On 12-Oct-2000, Sengan <senganb@ia.nsc.com> wrote:
Now that ghc 4.08 has a time profiler, I've been improving a program I wrote over the last year. However now the GC time dominates the execution time (>60%). I can see that my program is not being lazy, but I have no idea why.
What makes you think that the GC time is due to insufficient laziness? My first thought is that high GC times may well be due to the opposite, too much laziness. Being lazy means that you create closures to represent unevaluated expressions, and those closures will eventually need to be garbage collected. -- Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit" PGP: finger fjh@128.250.37.3 | -- the last words of T. S. Garp.
Sengan <senganb@ia.nsc.com> wrote,
Now that ghc 4.08 has a time profiler, I've been improving a program I wrote over the last year. However now the GC time dominates the execution time (>60%). I can see that my program is not being lazy, but I have no idea why. How can I use profiling (or any other means) to determine where my program is not being sufficiently lazy? Are there papers on such things I could read?
If GC times dominates, you probably have a space leak. So, you should use space profiling to determine where the leak is. Depending on what kind of program you have, it is often also informative to check the space profiles for different kinds of inputs, as the leak might only occur for certain inputs. Depending on the code exercised by the inputs triggering the leak, you might get a rough idea which parts of your program leak. Cheers, Manuel
participants (3)
-
Fergus Henderson -
Manuel M. T. Chakravarty -
Sengan