Abstract
Profiling tools, which measure and display the dynamic space and time behaviour of programs, are essential for identifying execution bottlenecks. A variety of such tools exist for conventional languages, but almost none for non-strict functional languages. There is a good reason for this: lazy evaluation means that the program is executed in an order which is not immediately apparent from the source code, so it is difficult to relate dynamically-gathered statistics back to the original source.
We present a new technique which solves this problem. The framework is general enough to profile both space and time behaviour. Better still, it is cheap to implement, and we describe how to do so in the context of the Spineless Tagless G-machine.
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
The author gratefully acknowledges the support of the Commonwealth Scholarship Commission.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
Bibliography
AW Appel, BF Duba & DB MacQueen, “Profiling in the presence of optimization and garbage collection,” SML Distribution, Nov 1988.
S Clayman, D Parrott & C Clack, “A profiling technique for lazy, higher-order functional programs,” Technical Report, Dept of Computer Science, University College London, Nov 1991.
SL Graham, PB Kessler & MK McKusick, “An execution profiler for modular programs,” Software — Practice and Experience 13 (1983), 671–685.
C Hall, K Hammond, W Partain, SL Peyton-Jones & P Wadler, “The glasgow haskell compiler: A retrospective,” in Functional Programming, Glasgow 1992, J Launchbury & PM Sansom, eds., Springer-Verlag, Workshops in Computing, Ayr, Scotland, 1992.
John Hughes, “Why functional programming matters,” The Computer Journal32 (Apr 1989).
SL Peyton-Jones, The Implementation of Functional Programming Languages,Prentice Hall, 1987.
SL Peyton-Jones, “Implementing lazy functional languages on stock hardware: the Spineless Tagless G-machine,” Journal of Functional Programming 2 (Apr 1992), 127–202.
C Runciman & D Wakeling, “Problems and proposals for time and space profiling of functional programs,” in Functional Programming, Glasgow 1990, SL Peyton-Jones, G Hutton & CK Holst, eds., Springer-Verlag, Workshops in Computing, Ullapool, Scotland, 1990.
C Runciman & D Wakeling, “Heap profiling of a lazy functional compiler,” in Functional Programming, Glasgow 1992, J Launchbury & PM Sansom, eds., Springer-Verlag, Workshops in Computing, Ayr, Scotland, 1992.
C Runciman & D Wakeling, “Heap profiling of lazy functional programs,” Technical Report 172, Dept of Computer Science, University of York, April 1992.
B Zorn & P Halfinger, “A memory allocation profiler for C and LISP programs,” in USENIX 88, San Francisco,1988, 223–237.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1993 British Computer Society
About this paper
Cite this paper
Sansom, P.M., Peyton Jones, S.L. (1993). Profiling Lazy Functional Programs. In: Launchbury, J., Sansom, P. (eds) Functional Programming, Glasgow 1992. Workshops in Computing. Springer, London. https://doi.org/10.1007/978-1-4471-3215-8_20
Download citation
DOI: https://doi.org/10.1007/978-1-4471-3215-8_20
Publisher Name: Springer, London
Print ISBN: 978-3-540-19820-8
Online ISBN: 978-1-4471-3215-8
eBook Packages: Springer Book Archive