Summary

We started this chapter by profiling programs by cost centres, which can be set automatically (-fprof-auto) or manually (SCC-annotations). We learned that there is overhead in profiling, which is why execution times are an inaccurate metric when profiling. Allocations remained a good measure of performance in any case. We used the heap profiler to produce informative graphs about memory usage over time, and to spot unwanted allocations and retainers.

We explored different options in the GHC heap profiler: break-downs and subset selections, both of which draw more or less from the same pool of parameters. The default break-down was by cost not yet finished.

Finally, we looked at two additional libraries, criterion for benchmarking and ekg ...

Get Haskell High Performance Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.