skip to main content
research-article

Parallel incremental whole-program optimizations for Scala.js

Published:19 October 2016Publication History
Skip Abstract Section

Abstract

Whole-program optimizations are powerful tools that can dramatically improve performance, size and other aspects of programs. Because they depend on global knowledge, they must typically be reapplied to the whole program when small changes are made, which makes them too slow for the development cycle. This is an issue for some environments that require, or benefit a lot from, whole-program optimizations, such as compilation to JavaScript or to the Dalvik VM, because their development cycle is slowed down either by the lack of optimizations, or by the time spent on applying them.

We present a new approach to designing incremental whole-program optimizers for object-oriented and functional languages: when part of a program changes, only the portions affected by the changes are reoptimized. An incremental optimizer using this approach for Scala.js, the Scala to JavaScript compiler, demonstrates speedups from 10x to 100x compared to its batch version. As a result, the optimizer's running time becomes insignificant compared to separate compilation, making it fit for use on every compilation run during the development cycle. We also show how to parallelize the incremental algorithm to take advantage of multicore hardware.

References

  1. Octane, the JavaScript benchmark suite for the modern web, 2015. {Online; accessed 30-November-2015}.Google ScholarGoogle Scholar
  2. M. Burke and L. Torczon. Interprocedural optimization: Eliminating unnecessary recompilation. ACM Trans. Program. Lang. Syst., 15(3):367–399, July 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. E. Burmako. Scala macros: Let our powers combine!: On how rich syntax and static types work with metaprogramming. In Proceedings of the 4th Workshop on Scala, SCALA ’13, pages 3:1–3:10, New York, NY, USA, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. C. Chambers, J. Dean, and D. Grove. A framework for selective recompilation in the presence of complex intermodule dependencies. In Proceedings of the 17th International Conference on Software Engineering, ICSE ’95, pages 221–230, New York, NY, USA, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. K. D. Cooper, K. Kennedy, and L. Torczon. Interprocedural optimization: Eliminating unnecessary recompilation. In Proceedings of the 1986 SIGPLAN Symposium on Compiler Construction, SIGPLAN ’86, pages 58–67, New York, NY, USA, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. J. A. Dean. Whole-program Optimization of Object-oriented Languages. PhD thesis, 1996. AAI9716832. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. S. Doeraene, T. Schlatter, and N. Stucki. Scala.js, 2015.Google ScholarGoogle Scholar
  8. I. Lakhin. Papa carlo, 2015.Google ScholarGoogle Scholar
  9. H. Li. Autowire, 2015.Google ScholarGoogle Scholar
  10. Y. Lu, L. Shang, X. Xie, and J. Xue. An incremental points-to analysis with CFL-reachability. In Proceedings of the 22Nd International Conference on Compiler Construction, CC’13, pages 61–81, Berlin, Heidelberg, 2013. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. H. Miller, P. Haller, E. Burmako, and M. Odersky. Instant pickles: Generating object-oriented pickler combinators for fast and extensible serialization. In Proceedings of the 2013 ACM SIGPLAN International Conference on Object Oriented Programming Systems Languages & Applications, OOPSLA ’13, pages 183–202, New York, NY, USA, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. L. L. Pollock and M. L. Soffa. Incremental compilation of optimized code. In Proceedings of the 12th ACM SIGACTSIGPLAN Symposium on Principles of Programming Languages, POPL ’85, pages 152–164, New York, NY, USA, 1985. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. L. L. Pollock and M. L. Soffa. Incremental global reoptimization of programs. ACM Trans. Program. Lang. Syst., 14(2): 173–200, Apr. 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. A. Prokopec, N. G. Bronson, P. Bagwell, and M. Odersky. Concurrent tries with efficient non-blocking snapshots. In Proceedings of the 17th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, PPoPP ’12, pages 151–160, New York, NY, USA, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. D. Saha and C. R. Ramakrishnan. Incremental and demanddriven points-to analysis using logic programming. In Proceedings of the 7th ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming, PPDP ’05, pages 117–128, New York, NY, USA, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. A. Sewe, J. Jochem, and M. Mezini. Next in line, please!: Exploiting the indirect benefits of inlining by accurately predicting further inlining. In Proceedings of the Compilation of the Co-located Workshops on DSM’11, TMC’11, AGERE!’11, AOOPES’11, NEAT’11, & VMIL’11, SPLASH ’11 Workshops, pages 317–328, New York, NY, USA, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. A. L. Souter and L. L. Pollock. Incremental call graph reanalysis for object-oriented software maintenance. In Proceedings of the IEEE International Conference on Software Maintenance (ICSM’01), ICSM ’01, pages 682–, Washington, DC, USA, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. L. Stadler, T. Würthinger, and H. Mössenböck. Partial escape analysis and scalar replacement for Java. In Proceedings of Annual IEEE/ACM International Symposium on Code Generation and Optimization, CGO ’14, pages 165:165–165:174, New York, NY, USA, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. F. Vivien and M. Rinard. Incrementalized pointer and escape analysis. In Proceedings of the ACM SIGPLAN 2001 Conference on Programming Language Design and Implementation, PLDI ’01, pages 35–46, New York, NY, USA, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. J.-S. Yur, B. G. Ryder, W. A. Landi, and P. Stocks. Incremental analysis of side effects for C software system. In Proceedings of the 19th International Conference on Software Engineering, ICSE ’97, pages 422–432, New York, NY, USA, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Parallel incremental whole-program optimizations for Scala.js

    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 51, Issue 10
      OOPSLA '16
      October 2016
      915 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/3022671
      Issue’s Table of Contents
      • cover image ACM Conferences
        OOPSLA 2016: Proceedings of the 2016 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications
        October 2016
        915 pages
        ISBN:9781450344449
        DOI:10.1145/2983990

      Copyright © 2016 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 19 October 2016

      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!