skip to main content
research-article

Causality of optimized Haskell: what is burning our cycles?

Published:23 September 2013Publication History
Skip Abstract Section

Abstract

Profiling real-world Haskell programs is hard, as compiler optimizations make it tricky to establish causality between the source code and program behavior. In this paper we attack the root issue by performing a causality analysis of functional programs under optimization. We apply our findings to build a novel profiling infrastructure on top of the Glasgow Haskell Compiler, allowing for performance analysis even of aggressively optimized programs.

References

  1. DWARF debugging information format, version 2. Technical report, UNIX International Programming Languages SIG, 1993.Google ScholarGoogle Scholar
  2. A. W. Appel, B. F. Duba, and D. B. MacQueen. Profiling in the presence of optimization and garbage collection. Technical Report CS-TR-197-88, Princeton University, Nov 1988.Google ScholarGoogle Scholar
  3. G. Brooks, G. J. Hansen, and S. Simmons. A new approach to debugging optimized code. In Proceedings of the SIGPLAN conference on programming language design and implementation, PLDI '92, pages 1--11, New York, NY, USA, 1992. ACM. ISBN 0-89791-475-9. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. D. Coutts, R. Leshchinskiy, and D. Stewart. Stream fusion: From lists to streams to nothing at all. In ICFP '07: Proceedings of the 12th ACM SIGPLAN international conference on functional programming, pages 315--326, New York, NY, USA, 2007. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. A. Gill and G. Hutton. The worker/wrapper transformation. Journal of Functional Programming, 19 (2): 227--251, Mar. 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. A. Gill and C. Runciman. Haskell program coverage. In Proceedings of the ACM SIGPLAN workshop on Haskell, Haskell '07, pages 1--12, New York, NY, USA, 2007. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. A. Gill, J. Launchbury, and S. L. Peyton Jones. A short cut to deforestation. In Proceedings of the conference on functional programming languages and computer architecture, FPCA '93, pages 223--232, New York, NY, USA, 1993. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. S. L. Graham, P. B. Kessler, and M. K. McKusick. gprof: A call graph execution profiler. In Proceedings of the symposium on compiler construction, pages 120--126, New York, NY, USA, 1982. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. D. Jones, Jr., S. Marlow, and S. Singh. Parallel performance tuning for Haskell. In Proceedings of the 2nd ACM SIGPLAN symposium on Haskell, Haskell '09, pages 81--92, New York, NY, USA, 2009. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. S. Kaneshiro and T. Shindo. Profiling optimized code: A profiling system for an hpf compiler. In Proceedings of the 10th International Parallel Processing Symposium, IPPS '96, pages 469--473, Washington, DC, USA, 1996. IEEE Computer Society. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. C. Lattner and V. Adve. LLVM: A compilation framework for lifelong program analysis & transformation. In Proceedings of the international symposium on code generation and optimization, CGO '04, pages 75--86, Washington, DC, USA, March 2004. IEEE Computer Society. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. J. Launchbury. A natural semantics for lazy evaluation. In Proceedings of the 20th ACM SIGPLAN-SIGACT symposium on principles of programming languages, POPL '93, pages 144--154, New York, NY, USA, 1993. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. D. Lewis. Counterfactuals. Blackwell Publishers, Oxford, 1973. ISBN 978-0-631-22425-9.Google ScholarGoogle Scholar
  14. S. Marlow. Why can't I get a stack trace? Sept. 2012. URL haskell.org/haskellwiki/HaskellImplementorsWorkshop/2012.Google ScholarGoogle Scholar
  15. W. Partain. The nofib benchmark suite of Haskell programs. In Functional Programming, Glasgow 1992, pages 195--202. Springer, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. R. Perera, U. A. Acar, J. Cheney, and P. B. Levy. Functional programs that explain their work. In Proceedings of the 17th ACM SIGPLAN international conference on Functional programming, ICFP '12, pages 365--376, New York, NY, USA, 2012. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. S. L. Peyton Jones and A. L. M. Santos. A transformation-based optimiser for Haskell. Science of Computer Programming, 32 (1--3): 3--47, Sep 1998. 6th European Symposium on Programming. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. S. L. Peyton Jones and S. Marlow. Secrets of the Glasgow Haskell compiler inliner. Journal of Functional Programming, 12 (5): 393--434, July 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. S. L. Peyton Jones, C. V. Hall, K. Hammond, W. Partain, and P. Wadler. The Glasgow Haskell compiler: a technical overview. In phProceedings of Joint Framework for Information Technology Technical Conference, JFIT '93, March 1993.Google ScholarGoogle Scholar
  20. S. L. Peyton Jones, W. Partain, and A. Santos. Let-floating: moving bindings to give faster programs. In Proceedings of the first ACM SIGPLAN international conference on functional programming, ICFP '96, pages 1--12, New York, NY, USA, 1996. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. S. L. Peyton Jones, T. Nordin, and D. Oliva. C--: A portable assembly language. In Implementation of Functional Languages, pages 1--19. Springer, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. S. L. Peyton Jones, A. Tolmach, and T. Hoare. Playing by the rules: Rewriting as a practical optimization technique in GHC. In Proceedings of the 2001 Haskell Workshop, Haskell '01, pages 203--233, Sept. 2001.Google ScholarGoogle Scholar
  23. N. Röjemo and C. Runciman. Lag, drag, void and use-heap profiling and space-efficient compilation revisited. In Proceedings of the first ACM SIGPLAN international conference on Functional programming, ICFP '96, pages 34--41, New York, NY, USA, 1996. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. P. M. Sansom. Execution Profiling for Non-strict Functional Languages. PhD thesis, University of Glasgow, 1994.Google ScholarGoogle Scholar
  25. 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): 334--385, Mar. 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. P. Sestoft. Deriving a lazy abstract machine. Journal of Functional Programming, 7 (03): 231--264, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. D. A. Terei and M. M. Chakravarty. An LLVM backend for GHC. In Proceedings of the third ACM Haskell symposium, Haskell '10, pages 109--120, New York, NY, USA, 2010. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. J. Tibell. State of Haskell, 2011 Survey, Aug. 2011. URL http://blog.johantibell.com/2011/08/results-from-state-of-haskell-2011.html.Google ScholarGoogle Scholar
  29. P. Wadler. The essence of functional programming. In Proceedings of the 19th symposium on principles of programming languages, POPL '92, pages 1--14, New York, NY, USA, 1992. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Causality of optimized Haskell: what is burning our cycles?

      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 48, Issue 12
        Haskell '13
        December 2013
        149 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/2578854
        Issue’s Table of Contents
        • cover image ACM Conferences
          Haskell '13: Proceedings of the 2013 ACM SIGPLAN symposium on Haskell
          September 2013
          158 pages
          ISBN:9781450323833
          DOI:10.1145/2503778

        Copyright © 2013 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 23 September 2013

        Check for updates

        Qualifiers

        • research-article
      • Article Metrics

        • Downloads (Last 12 months)4
        • Downloads (Last 6 weeks)0

        Other Metrics

      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!