skip to main content
research-article

Worker/wrapper/makes it/faster

Published:19 August 2014Publication History
Skip Abstract Section

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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. R. M. Burstall and J. Darlington. A Transformation System for Developing Recursive Programs. Journal of the ACM, 24 (1):44--67, 1977. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. K. Claessen and J. Hughes. QuickCheck: A Lightweight Tool for Random Testing of Haskell Programs. In ICFP. ACM, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. T. Coquand. Infinite Objects in Type Theory. In TYPES '93, volume 806 of Lecture Notes in Computer Science. Springer, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. A. Gill and G. Hutton. The Worker/Wrapper Transformation. Journal of Functional Programming, 19(2), 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.Google ScholarGoogle ScholarCross RefCross Ref
  9. J. Gustavsson and D. Sands. Possibilities and Limitations of Call-by-Need Space Improvement. In ICFP, pages 265--276. ACM, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.Google ScholarGoogle Scholar
  11. C. Hope. A Functional Semantics for Space and Time. PhD thesis, School of Computer Science, University of Nottingham, 2008.Google ScholarGoogle Scholar
  12. J. Hughes. A Novel Representation of Lists and its Application to the Function "reverse". Information Processing Letters, 22(3):141--144, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. J. Launchbury. A Natural Semantics for Lazy Evaluation. In POPL '93, pages 144--154. ACM, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. C. Okasaki. Purely Functional Data Structures. Cambridge University Press, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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/.Google ScholarGoogle Scholar
  19. W. Partain. The nofib Benchmark Suite of Haskell Programs. In Glasgow Workshop on Functional Programming, pages 195--202. Springer, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. S. L. Peyton Jones. Compiling Haskell by Program Transformation: A Report from the Trenches. In ESOP, pages 18--44. Springer, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. D. Sands. Operational Theories of Improvement in Functional Languages (Extended Abstract). In Glasgow Workshop on Functional Programming, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. D. Sands. From SOS Rules to Proof Principles: An Operational Metatheory for Functional Languages. In POPL '97, pages 428--441. ACM Press, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. D. Sands. Improvement Theory and its Applications. In Higher Order Operational Techniques in Semantics, Publications of the Newton Institute. Cambridge University Press, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. N. Sculthorpe and G. Hutton. Work It, Wrap It, Fix It, Fold It. Journal of Functional Programming, 2014.Google ScholarGoogle Scholar
  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.Google ScholarGoogle ScholarCross RefCross Ref
  27. P. Sestoft. Deriving a Lazy Abstract Machine. Journal of Functional Programming, 7(3):231--264, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. D. A. Turner. Elementary Strong Functional Programming. In FPLE '95, volume 1022 of Lecture Notes in Computer Science. Springer, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. C. P. Wadsworth. Semantics and Pragmatics of the Lambda Calculus. PhD thesis, Computing Laboratory, University of Oxford, 1971.Google ScholarGoogle Scholar
  31. O. Wilde. Lady Windermere's Fan, A Play About a Good Woman. First performed in 1892.Google ScholarGoogle Scholar

Index Terms

  1. Worker/wrapper/makes it/faster

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    • Published in

      cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 49, Issue 9
      ICFP '14
      September 2014
      361 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/2692915
      Issue’s Table of Contents
      • 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

      Copyright © 2014 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 19 August 2014

      Check for updates

      Qualifiers

      • research-article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!