Skip to main content

Profiling Lazy Functional Programs

  • Conference paper
Functional Programming, Glasgow 1992

Part of the book series: Workshops in Computing ((WORKSHOPS COMP.))

  • 89 Accesses

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.

The author gratefully acknowledges the support of the Commonwealth Scholarship Commission.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Bibliography

  1. AW Appel, BF Duba & DB MacQueen, “Profiling in the presence of optimization and garbage collection,” SML Distribution, Nov 1988.

    Google Scholar 

  2. 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.

    Google Scholar 

  3. SL Graham, PB Kessler & MK McKusick, “An execution profiler for modular programs,” Software — Practice and Experience 13 (1983), 671–685.

    Article  MATH  Google Scholar 

  4. 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.

    Google Scholar 

  5. John Hughes, “Why functional programming matters,” The Computer Journal32 (Apr 1989).

    Google Scholar 

  6. SL Peyton-Jones, The Implementation of Functional Programming Languages,Prentice Hall, 1987.

    Google Scholar 

  7. SL Peyton-Jones, “Implementing lazy functional languages on stock hardware: the Spineless Tagless G-machine,” Journal of Functional Programming 2 (Apr 1992), 127–202.

    Article  MATH  Google Scholar 

  8. 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.

    Google Scholar 

  9. 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.

    Google Scholar 

  10. C Runciman & D Wakeling, “Heap profiling of lazy functional programs,” Technical Report 172, Dept of Computer Science, University of York, April 1992.

    Google Scholar 

  11. B Zorn & P Halfinger, “A memory allocation profiler for C and LISP programs,” in USENIX 88, San Francisco,1988, 223–237.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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

Publish with us

Policies and ethics