Abstract
Much research in program optimization has focused on formal approaches to correctness: proving that the meaning of programs is preserved by the optimisation. Paradoxically, there has been comparatively little work on formal approaches to efficiency: proving that the performance of optimized programs is actually improved. This paper addresses this problem for a general-purpose optimization technique, the worker/wrapper transformation. In particular, we use the call-by-need variant of improvement theory to establish conditions under which the worker/wrapper transformation is formally guaranteed to preserve or improve the time performance of programs in lazy languages such as Haskell.
Highlights
To misquote Oscar Wilde [31], “functional programmers know the value of everything and the cost of nothing”1
In this paper we formally prove that this transformation is guaranteed to preserve or improve time performance with respect to an established operational theory
We have shown how improvement theory can be used to justify the worker/wrapper transformation as a program optimisation, by formally proving that, under certain natural conditions, the transformation is guaranteed to preserve or improve time performance
Summary
To misquote Oscar Wilde [31], “functional programmers know the value of everything and the cost of nothing”. The functional approach to programming emphasises what programs mean in a denotational sense, rather than what programs do in terms of their operational behaviour. For many programming tasks this emphasis is entirely appropriate, allowing the programmer to focus on the high-level description of what is being computed rather than the low-level details of how this is realised. In the context of program optimisation both aspects play a central role, as the aim of optimisation is to improve the operational performance of programs while maintaining their denotational correctness. A research paper on program optimisation should justify both the correctness and performance aspects of the optimisation described. There is a whole spectrum of possible approaches to this, ranging from informal tests and benchmarks [19], to tool-based methods such as property-
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have
Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.