Journal of Functional Programming

Articles

Heap profiling of lazy functional programs

Colin Runcimana1 and David Wakelinga1

a1 Department of Computer Science, University of York, Heslington, York YO1 5DD, UK (e-mail: colin@minster.york.ac.uk, dw@minster.york.ac.uk)

Abstract

We describe the design, implementation and use of a new kind of profiling tool that yields valuable information about the memory use of lazy functional programs. The tool has two parts: a modified functional language implementation which generates profiling information during the execution of programs, and a separate program which converts this information to graphical form. With the aid of profile graphs, one can make alterations to a functional program which dramatically reduce its space consumption. We demonstrate this in the case of a genuine example - the first to which the tool was applied - for which the results are strikingly successful.