Lexical profiling: theory and practice
- 1 January 1995
- journal article
- research article
- Published by Cambridge University Press (CUP) in Journal of Functional Programming
- Vol. 5 (2) , 225-277
- https://doi.org/10.1017/s0956796800001337
Abstract
This paper addresses the issue of analysing the run-time behaviour of lazy, higher-order functional programs. We examine the difference between the way that functional programmers and functional language implementors view program behaviour. Existing profiling techniques are discussed and a new technique is proposed which produces results that are straightforward for programmers to assimilate. The new technique, which we call lexical profiling, collects information about the run-time behaviour of functional programs, and reports the results with respect to the original source code rather than simply listing the actions performed at run-time. Lexical profiling complements implementation-specific profiling and is important because it provides a view of program activity which is largely independent of the underlying evaluation mechanism. Using the lexical profiler, programmers may easily relate results back to the source program. We give a full implementation of the lexical profiling technique for a sequential, interpretive graph reduction engine, and extensions for compiled and parallel graph reduction are discussed.Keywords
This publication has 8 references indexed in Scilit:
- Heap profiling of lazy functional programsJournal of Functional Programming, 1993
- Reference Counting of Cyclic Graphs for Functional ProgramsThe Computer Journal, 1990
- Why Functional Programming MattersThe Computer Journal, 1989
- The Chalmers Lazy-ML CompilerThe Computer Journal, 1989
- GprofACM SIGPLAN Notices, 1982
- Garbage Collection of Linked Data StructuresACM Computing Surveys, 1981
- List processing in real time on a serial computerCommunications of the ACM, 1978
- An empirical study of FORTRAN programsSoftware: Practice and Experience, 1971