skip to main content
10.1145/2628136.2628142acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

Worker/wrapper/makes it/faster

Published: 19 August 2014 Publication History

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.

References

[1]
Z. M. Ariola, M. Felleisen, J. Maraist, M. Odersky, and P. Wadler. The Call-by-Need Lambda Calculus. In POPL '95, pages 233--246. ACM, 1995.
[2]
R. M. Burstall and J. Darlington. A Transformation System for Developing Recursive Programs. Journal of the ACM, 24 (1):44--67, 1977.
[3]
K. Claessen and J. Hughes. QuickCheck: A Lightweight Tool for Random Testing of Haskell Programs. In ICFP. ACM, 2000.
[4]
T. Coquand. Infinite Objects in Type Theory. In TYPES '93, volume 806 of Lecture Notes in Computer Science. Springer, 1993.
[5]
E. Dubuc and R. Street. Dinatural Transformations. In Lecture Notes in Mathematics, volume 137 of Lecture Notes in Mathematics, pages 126--137. Springer Berlin Heidelberg, 1970.
[6]
A. Farmer, A. Gill, E. Komp, and N. Sculthorpe. The HERMIT in the Machine: A Plugin for the Interactive Transformation of GHC Core Language Programs. In Haskell Symposium (Haskell '12), pages 1--12. ACM, 2012.
[7]
A. Gill and G. Hutton. The Worker/Wrapper Transformation. Journal of Functional Programming, 19(2), 2009.
[8]
J. Gustavsson and D. Sands. A Foundation for Space-Safe Transformations of Call-by-Need Programs. Electronic Notes on Theoretical Computer Science, 26:69--86, 1999.
[9]
J. Gustavsson and D. Sands. Possibilities and Limitations of Call-by-Need Space Improvement. In ICFP, pages 265--276. ACM, 2001.
[10]
J. Hackett, G. Hutton, and M. Jaskelioff. The Under Performing Unfold: A New Approach to Optimising Corecursive Programs. 2013. To appear in the volume of selected papers from the 25th International Symposium on Implementation and Application of Functional Languages, Nijmegen, The Netherlands, August 2013.
[11]
C. Hope. A Functional Semantics for Space and Time. PhD thesis, School of Computer Science, University of Nottingham, 2008.
[12]
J. Hughes. A Novel Representation of Lists and its Application to the Function "reverse". Information Processing Letters, 22(3):141--144, 1986.
[13]
G. Hutton, M. Jaskelioff, and A. Gill. Factorising Folds for Faster Functions. Journal of Functional Programming Special Issue on Generic Programming, 20(3&4), June 2010.
[14]
J. Launchbury. A Natural Semantics for Lazy Evaluation. In POPL '93, pages 144--154. ACM, 1993.
[15]
A. Moran and D. Sands. Improvement in a Lazy Context: An Operational Theory for Call-by-Need. Extended version of {16}, available at http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.37.144&rep=rep1&type=pdf.
[16]
A. Moran and D. Sands. Improvement in a Lazy Context: An Operational Theory for Call-by-Need. In POPL '99, pages 43--56. ACM, 1999.
[17]
C. Okasaki. Purely Functional Data Structures. Cambridge University Press, 1999.
[18]
B. O'Sullivan. Criterion, A New Benchmarking Library for Haskell, 2009. URL http://www.serpentine.com/blog/2009/09/29/criterion-a-new-benchmarking-libraryfor-haskell/.
[19]
W. Partain. The nofib Benchmark Suite of Haskell Programs. In Glasgow Workshop on Functional Programming, pages 195--202. Springer, 1992.
[20]
S. L. Peyton Jones. Compiling Haskell by Program Transformation: A Report from the Trenches. In ESOP, pages 18--44. Springer, 1996.
[21]
D. Sands. Operational Theories of Improvement in Functional Languages (Extended Abstract). In Glasgow Workshop on Functional Programming, 1991.
[22]
D. Sands. From SOS Rules to Proof Principles: An Operational Metatheory for Functional Languages. In POPL '97, pages 428--441. ACM Press, 1997.
[23]
D. Sands. Improvement Theory and its Applications. In Higher Order Operational Techniques in Semantics, Publications of the Newton Institute. Cambridge University Press, 1997.
[24]
P. M. Sansom and S. L. Peyton Jones. Formally Based Profiling for Higher-Order Functional Languages. ACM Transactions on Programming Languages and Systems, 19(2), 1997.
[25]
N. Sculthorpe and G. Hutton. Work It, Wrap It, Fix It, Fold It. Journal of Functional Programming, 2014.
[26]
N. Sculthorpe, A. Farmer, and A. Gill. The HERMIT in the Tree: Mechanizing Program Transformations in the GHC Core Language. In Proceedings of Implementation and Application of Functional Languages (IFL '12), volume 8241 of Lecture Notes in Computer Science, pages 86--103, 2013.
[27]
P. Sestoft. Deriving a Lazy Abstract Machine. Journal of Functional Programming, 7(3):231--264, 1997.
[28]
D. A. Turner. Elementary Strong Functional Programming. In FPLE '95, volume 1022 of Lecture Notes in Computer Science. Springer, 1995.
[29]
J. Voigtländer and P. Johann. Selective Strictness and Parametricity in Structural Operational Semantics, Inequationally. Theor. Comput. Sci., 388(1-3):290--318, 2007.
[30]
C. P. Wadsworth. Semantics and Pragmatics of the Lambda Calculus. PhD thesis, Computing Laboratory, University of Oxford, 1971.
[31]
O. Wilde. Lady Windermere's Fan, A Play About a Good Woman. First performed in 1892.

Cited By

View all
  • (2019)Call-by-need is clairvoyant call-by-valueProceedings of the ACM on Programming Languages10.1145/33417183:ICFP(1-23)Online publication date: 26-Jul-2019
  • (2019)Improving HaskellZivilgesellschaft und Wohlfahrtsstaat im Wandel10.1007/978-3-030-18506-0_6(114-135)Online publication date: 24-Apr-2019
  • (2018)Space Improvements and Equivalences in a Functional Core LanguageElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.265.8265(98-112)Online publication date: 16-Feb-2018
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
ICFP '14: Proceedings of the 19th ACM SIGPLAN international conference on Functional programming
August 2014
390 pages
ISBN:9781450328739
DOI:10.1145/2628136
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 19 August 2014

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. general recursion
  2. improvement

Qualifiers

  • Research-article

Conference

ICFP'14
Sponsor:

Acceptance Rates

ICFP '14 Paper Acceptance Rate 28 of 85 submissions, 33%;
Overall Acceptance Rate 333 of 1,064 submissions, 31%

Upcoming Conference

ICFP '25
ACM SIGPLAN International Conference on Functional Programming
October 12 - 18, 2025
Singapore , Singapore

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)2
  • Downloads (Last 6 weeks)0
Reflects downloads up to 13 Dec 2024

Other Metrics

Citations

Cited By

View all
  • (2019)Call-by-need is clairvoyant call-by-valueProceedings of the ACM on Programming Languages10.1145/33417183:ICFP(1-23)Online publication date: 26-Jul-2019
  • (2019)Improving HaskellZivilgesellschaft und Wohlfahrtsstaat im Wandel10.1007/978-3-030-18506-0_6(114-135)Online publication date: 24-Apr-2019
  • (2018)Space Improvements and Equivalences in a Functional Core LanguageElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.265.8265(98-112)Online publication date: 16-Feb-2018
  • (2018)Sequential and Parallel Improvements in a Concurrent Functional Programming LanguageProceedings of the 20th International Symposium on Principles and Practice of Declarative Programming10.1145/3236950.3236952(1-13)Online publication date: 3-Sep-2018
  • (2018)Parametric polymorphism and operational improvementProceedings of the ACM on Programming Languages10.1145/32367632:ICFP(1-24)Online publication date: 30-Jul-2018
  • (2015)Sharing-aware improvements in a call-by-need functional core languageProceedings of the 27th Symposium on the Implementation and Application of Functional Programming Languages10.1145/2897336.2897343(1-12)Online publication date: 14-Sep-2015
  • (2015)Formally proving a compiler transformation safeACM SIGPLAN Notices10.1145/2887747.280431250:12(35-46)Online publication date: 30-Aug-2015
  • (2015)Formally proving a compiler transformation safeProceedings of the 2015 ACM SIGPLAN Symposium on Haskell10.1145/2804302.2804312(35-46)Online publication date: 30-Aug-2015
  • (2015)Improvements in a functional core language with call-by-need operational semanticsProceedings of the 17th International Symposium on Principles and Practice of Declarative Programming10.1145/2790449.2790512(220-231)Online publication date: 14-Jul-2015
  • (2015)Programs for Cheap!Proceedings of the 2015 30th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS)10.1109/LICS.2015.21(115-126)Online publication date: 6-Jul-2015
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media