Hostname: page-component-78c5997874-s2hrs Total loading time: 0 Render date: 2024-11-10T12:24:26.305Z Has data issue: false hasContentIssue false

Lexical profiling: theory and practice

Published online by Cambridge University Press:  07 November 2008

Chris Clack
Affiliation:
Department of Computer Science, University College London, Gower Street, London WC1E, UK (email: {clack,sclayman,dparrott}@cs.ucl.ac.uk)
Stuart Clayman
Affiliation:
Department of Computer Science, University College London, Gower Street, London WC1E, UK (email: {clack,sclayman,dparrott}@cs.ucl.ac.uk)
David Parrott
Affiliation:
Department of Computer Science, University College London, Gower Street, London WC1E, UK (email: {clack,sclayman,dparrott}@cs.ucl.ac.uk)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

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.

Type
Articles
Copyright
Copyright © Cambridge University Press 1995

References

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.Google Scholar
Augustsson, L. and Johnsson, T. (1989a) The Chalmers Lazy ML compiler. The Computer Journal, 32(2):127141.CrossRefGoogle Scholar
Augustsson, L. and Johnsson, T. (1989b) Parallel graph reduction with the 〈v, G〉-machine. In: Proc. FPCA Conference, pp. 202213. ACM.Google Scholar
Augustsson, L. (1984) A compiler for Lazy ML. In: Symposium on Lisp and Functional Programming, pp. 218227. ACM.Google Scholar
Axford, T. H. (1990) Reference counting of cyclic graphs for functional programs. The Computer Journal.CrossRefGoogle Scholar
Baker, H. G. (1978) List processing in real time on a serial computer. Comm. ACM, 21(4): 280294.CrossRefGoogle Scholar
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.Google Scholar
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.Google Scholar
Cohen, J. (1981) Garbage collection of linked data structures. ACM Comput. Surv. 13(3).CrossRefGoogle Scholar
Clack, C. D. and Parrott, D. J. (1993) Compiled lexical profiling for tim. In preparation.Google Scholar
Clack, C. D. and Peyton Jones, S. L. (1986) The four-stroke reduction engine. In: Proc. Lisp and Functional Programming Conference, pp. 220232. ACM.Google Scholar
Clayman, S. (1993) Developing and Measuring a Parallel Rule Based System in a Functional Programming Environment. PhD thesis. University College London.Google Scholar
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.Google Scholar
Ferguson, A. B. and Wadler, P. (1988) When will deforestation stop. Technical report, University of Glasgow, Department of Computing.Google Scholar
Graham, S. L., Kessler, P. B. and McKusick, M. K. (1982) gprof: a call graph execution profiler. ACM Sigplan Notices, 17(6): 120126.CrossRefGoogle Scholar
Glaser, H., Reeve, M. and Wright, S. (1988) An analysis of reference count garbage collection schemes for declarative languages. Technical report, Imperial College London.Google Scholar
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.Google Scholar
Hudak, P. (1986) A semantic model of reference counting and its abstraction (detailed summary). In: Proc. Lisp and Functional Programming Conference, pp. 351363. ACM.Google Scholar
Hughes, J. (1985) A distributed garbage collection algorithm. In: Proc. FPCA Conference, pp. 256272. ACM,Google Scholar
Hughes, J. (1987) Managing reduction graphs with reference counts. Technical Report CSC/87/R2, University of Glasgow.Google Scholar
Hughes, J. (1989) Why functional programming matters. The Computer Journal, 32(2): 98107.CrossRefGoogle Scholar
Johnsson, T. (1984) Efficient compilation of lazy evaluation. In: Proc. Conference on Compiler Construction, pp. 5869. ACM.Google Scholar
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.Google Scholar
Kozato, Y. and Otto, P. (1993) Benchmarking real-life image processing programs in lazy functional languages. In: Proc. FPCA Conference. ACM.Google Scholar
Knuth, D.E. (1971) An Empirical Study of FORTRAN Programs. Software – Practice and Experience, 1: 105133.CrossRefGoogle Scholar
Lermen, C-W. and Maurer, D. (1986) A protocol for distributed reference counting. In: Proc. Lisp and Functional Programming Conference, pp. 343350. ACM.Google Scholar
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.Google Scholar
Parrott, D. J. (1993) Synthesising Parallel Functional Programs to Improve Dynamic Scheduling. PhD thesis, University College London.Google Scholar
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.Google Scholar
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.)Google Scholar
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.)Google Scholar
Peyton Jones, S. L. (1987a) The tag is dead – long live the packet. Posting on fp electronic mailing list.Google Scholar
Peyton Jones, S. L. (1987b) The Implementation of Functional Programming Languages. Prentice Hall.Google Scholar
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.Google Scholar
Peyton Jones, S. L. and Lester, D. R. (1992) Implementing Functional Languages: a tutorial. Prentice Hall.Google Scholar
Peyton Jones, S. L. and Salkild, J. (1989) The Spineless Tagless G-Machine. In: Proc. FPCA Conference, pp. 184201.Google Scholar
Rudalics, M. (1986) Distributed copying garbage collection. In: Proc. Lisp and Functional Programming Conference, pp. 364372. ACM.Google Scholar
Runciman, C. and Wakeling, D. (1992) Heap profiling of a lazy functional compiler. In: Proc. Glasgow Workshop in Functional Programming. Springer-Verlag.Google Scholar
Runciman, C. and Wakeling, D. (1993) Heap profiling of lazy functional programs. J. Functional Programming, 3(2).CrossRefGoogle Scholar
Shute, M. J. (1988) Y-less execution through fractional reference-counting. Draft report, Middlesex Polytechnic.Google Scholar
Sansom, P. M. and Peyton Jones, S. L. (1992) Profiling lazy functional languages. In: Proc. Glasgow Workshop in Functional Programming, pp. 227239. Springer-Verlag.Google Scholar
Sansom, P. M. (1993) Time profiling a lazy functional compiler. In: Proc. Glasgow Workshop in Functional Programming. Springer-Verlag.Google Scholar
Sansom, P. M. (1994) Execution Profiling for Non-strict Functional Languages. PhD Thesis (in preparation), University of Glasgow, Department of Computing.Google Scholar
Tolmach, A. P. and Dingle, A. T. (1990) Debugging in Standard ML of New Jersey. Distributed with the New Jersey SML compiler.Google Scholar
Turner, D. A. (1985) Miranda: A non:strict functional language with polymorphic types. In: Proc. FPCA Conference, pp. 116. ACM,Google Scholar
Wright, P. J. (1994) Optimised Redundant Cell Collection for Graph Reduction. PhD thesis, University College London, Department of Electronic Engineering.Google Scholar
Zorn, A. B. and Hilfinger, P. (1988) A memory allocation profiler for C and LISP programs. In: Proc. USENIX Conference, pp. 223237.Google Scholar
Submit a response

Discussions

No Discussions have been published for this article.