Skip to main content Accessibility help
×
Home

Lexical profiling: theory and practice

  • Chris Clack (a1), Stuart Clayman (a1) and David Parrott (a1)

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.

Copyright

References

Hide All
Appel, A. W., Duba, B. F. and MacQueen, D. B. (1988) Profiling in the presence of optimization and garbage collection. Distributed with the New Jersey SML compiler.
Augustsson, L. and Johnsson, T. (1989a) The Chalmers Lazy ML compiler. The Computer Journal, 32(2):127141.
Augustsson, L. and Johnsson, T. (1989b) Parallel graph reduction with the 〈v, G〉-machine. In: Proc. FPCA Conference, pp. 202213. ACM.
Augustsson, L. (1984) A compiler for Lazy ML. In: Symposium on Lisp and Functional Programming, pp. 218227. ACM.
Axford, T. H. (1990) Reference counting of cyclic graphs for functional programs. The Computer Journal.
Baker, H. G. (1978) List processing in real time on a serial computer. Comm. ACM, 21(4): 280294.
Burn, G. L., Peyton Jones, S. L. and Robson, J. (1988) The Spineless G-Machine. In: Proc. Lisp and Functional Programming Conference, pp 244258. Snowbird, UT.
Burn, G. L. (1987) Evaluation transformers – a model for the parallel evaluation of functional languages. In: Proc. FPCA Conference, pp. 446470. ACM, Springer Verlag. (extended abstract), LNCS 274.
Cohen, J. (1981) Garbage collection of linked data structures. ACM Comput. Surv. 13(3).
Clack, C. D. and Parrott, D. J. (1993) Compiled lexical profiling for tim. In preparation.
Clack, C. D. and Peyton Jones, S. L. (1986) The four-stroke reduction engine. In: Proc. Lisp and Functional Programming Conference, pp. 220232. ACM.
Clayman, S. (1993) Developing and Measuring a Parallel Rule Based System in a Functional Programming Environment. PhD thesis. University College London.
Fairbairn, J. and Wray, S. C. (1987) Tim: A simple, lazy abstract machine to execute supercombinators. In: Proc. FPCA Conference. Lecture Notes in Computer Science Vol. 274. Springer-Verlag.
Ferguson, A. B. and Wadler, P. (1988) When will deforestation stop. Technical report, University of Glasgow, Department of Computing.
Graham, S. L., Kessler, P. B. and McKusick, M. K. (1982) gprof: a call graph execution profiler. ACM Sigplan Notices, 17(6): 120126.
Glaser, H., Reeve, M. and Wright, S. (1988) An analysis of reference count garbage collection schemes for declarative languages. Technical report, Imperial College London.
Grant, P. W., Sharp, J. A., Webster, M. F. and Zhang, X. (1993) Some issues in a functional implementation of a finite element algorithm. In: Proc. FPCA Conference. ACM.
Hudak, P. (1986) A semantic model of reference counting and its abstraction (detailed summary). In: Proc. Lisp and Functional Programming Conference, pp. 351363. ACM.
Hughes, J. (1985) A distributed garbage collection algorithm. In: Proc. FPCA Conference, pp. 256272. ACM,
Hughes, J. (1987) Managing reduction graphs with reference counts. Technical Report CSC/87/R2, University of Glasgow.
Hughes, J. (1989) Why functional programming matters. The Computer Journal, 32(2): 98107.
Johnsson, T. (1984) Efficient compilation of lazy evaluation. In: Proc. Conference on Compiler Construction, pp. 5869. ACM.
King, I. (1990) The efficiency and generalisation of the various abstract machines. In: M. J., Plasmeijer (ed), 2nd International Workshop on Implementation of Functional Languages on Parallel Architectures, pp. 255280. University of Nijmegen.
Kozato, Y. and Otto, P. (1993) Benchmarking real-life image processing programs in lazy functional languages. In: Proc. FPCA Conference. ACM.
Knuth, D.E. (1971) An Empirical Study of FORTRAN Programs. Software – Practice and Experience, 1: 105133.
Lermen, C-W. and Maurer, D. (1986) A protocol for distributed reference counting. In: Proc. Lisp and Functional Programming Conference, pp. 343350. ACM.
Nilsson, H. and Fritzson, P. (1992) Algorithmic debugging for lazy functional languages. In: Proc. Fourth International Symposium on Programming Language Implementation and Logic Programming, Linköping, Sweden.
Parrott, D. J. (1993) Synthesising Parallel Functional Programs to Improve Dynamic Scheduling. PhD thesis, University College London.
Parrott, D. J. and Clayman, S. (1990) Report on ‘cost’ and ‘debug’ primitive extensions to FLIC. Research note RN/91/79, Department of Computer Science, University College London.
Parrott, D. J. and Clack, C. D. (1991) A common graphical form. In: Proc. Phoenix Seminar & Workshop on Declarative Programming, pp. 224238. Springer-Verlag. (Also Research Note RN/91/27 Dept. of Computer Science, University College London.)
Parrott, D. J. and Clack, C. D. (1992) Paragon – a language for modelling lazy, functional workloads on distributed processors. In: Proc. UK Performance Engineering Workshop. (Also UCL Research note RN/92/72.)
Peyton Jones, S. L. (1987a) The tag is dead – long live the packet. Posting on fp electronic mailing list.
Peyton Jones, S. L. (1987b) The Implementation of Functional Programming Languages. Prentice Hall.
Peyton Jones, S. L. and Joy, M. S. (1989) FLIC – a Functional Language Intermediate Code. Internal Note 2048, University College London, Department of Computer Science.
Peyton Jones, S. L. and Lester, D. R. (1992) Implementing Functional Languages: a tutorial. Prentice Hall.
Peyton Jones, S. L. and Salkild, J. (1989) The Spineless Tagless G-Machine. In: Proc. FPCA Conference, pp. 184201.
Rudalics, M. (1986) Distributed copying garbage collection. In: Proc. Lisp and Functional Programming Conference, pp. 364372. ACM.
Runciman, C. and Wakeling, D. (1992) Heap profiling of a lazy functional compiler. In: Proc. Glasgow Workshop in Functional Programming. Springer-Verlag.
Runciman, C. and Wakeling, D. (1993) Heap profiling of lazy functional programs. J. Functional Programming, 3(2).
Shute, M. J. (1988) Y-less execution through fractional reference-counting. Draft report, Middlesex Polytechnic.
Sansom, P. M. and Peyton Jones, S. L. (1992) Profiling lazy functional languages. In: Proc. Glasgow Workshop in Functional Programming, pp. 227239. Springer-Verlag.
Sansom, P. M. (1993) Time profiling a lazy functional compiler. In: Proc. Glasgow Workshop in Functional Programming. Springer-Verlag.
Sansom, P. M. (1994) Execution Profiling for Non-strict Functional Languages. PhD Thesis (in preparation), University of Glasgow, Department of Computing.
Tolmach, A. P. and Dingle, A. T. (1990) Debugging in Standard ML of New Jersey. Distributed with the New Jersey SML compiler.
Turner, D. A. (1985) Miranda: A non:strict functional language with polymorphic types. In: Proc. FPCA Conference, pp. 116. ACM,
Wright, P. J. (1994) Optimised Redundant Cell Collection for Graph Reduction. PhD thesis, University College London, Department of Electronic Engineering.
Zorn, A. B. and Hilfinger, P. (1988) A memory allocation profiler for C and LISP programs. In: Proc. USENIX Conference, pp. 223237.

Related content

Powered by UNSILO

Lexical profiling: theory and practice

  • Chris Clack (a1), Stuart Clayman (a1) and David Parrott (a1)

Metrics

Altmetric attention score

Full text views

Total number of HTML views: 0
Total number of PDF views: 0 *
Loading metrics...

Abstract views

Total abstract views: 0 *
Loading metrics...

* Views captured on Cambridge Core between <date>. This data will be updated every 24 hours.

Usage data cannot currently be displayed.

Lexical profiling: theory and practice

  • Chris Clack (a1), Stuart Clayman (a1) and David Parrott (a1)
Submit a response

Discussions

No Discussions have been published for this article.

×

Reply to: Submit a response


Your details


Conflicting interests

Do you have any conflicting interests? *