Execution Profiling for Non-Strict Functional Languages

Sansom, Patrick M (1994) Execution Profiling for Non-Strict Functional Languages. PhD thesis, University of Glasgow.

Full text available as:
[img]
Preview
PDF
Download (7MB) | Preview

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. This thesis examines the difficulties of profiling lazy higher-order functional languages and develops a profiling tool which overcomes them. It relates information about both the time and space requirements of the program back to the original source expressions identified by the programmer. Considerable attention is paid to the cost semantics with two abstract cost semantics, lexical scoping and evaluation scoping, being investigated. Experience gained from the two profiling schemes led to the development of a hybrid cost semantics. All three schemes are described and compared in a single formal framework. These abstract cost semantics are mapped onto an operational semantics and an implementation based on the STG-machine is developed. The manipulation of cost centres is made precise by extending the state-transition operational semantics of the STG-machine. The profiling tool has been incorporated into the Glasgow Haskell compiler ghc. Our approach preserves the correct cost attribution of costs while allowing program optimisation to proceed largely unhindered. So far as we know ghc is the only lazy functional language compiler to support source-level time profiling. The use of the profiler has lead to significant performance improvements in the compiler itself and other large application programs.

Item Type: Thesis (PhD)
Qualification Level: Doctoral
Additional Information: Adviser: Simon Peyton Jones
Keywords: Computer science
Date of Award: 1994
Depositing User: Enlighten Team
Unique ID: glathesis:1994-75809
Copyright: Copyright of this thesis is held by the author.
Date Deposited: 19 Nov 2019 18:08
Last Modified: 19 Nov 2019 18:08
URI: http://theses.gla.ac.uk/id/eprint/75809

Actions (login required)

View Item View Item

Downloads

Downloads per month over past year