skip to main content
research-article

The impact of optional type information on jit compilation of dynamically typed languages

Published:24 October 2011Publication History
Skip Abstract Section

Abstract

Optionally typed languages enable direct performance comparisons between untyped and type annotated source code. We present a comprehensive performance evaluation of two different JIT compilers in the context of ActionScript, a production-quality optionally typed language. One JIT compiler is optimized for quick compilation rather than JIT compiled code performance. The second JIT compiler is a more aggressively optimizing compiler, performing both high-level and low-level optimizations.

We evaluate both JIT compilers directly on the same benchmark suite, measuring their performance changes across fully typed, partially typed, and untyped code. Such evaluations are especially relevant to dynamically typed languages such as JavaScript, which are currently evaluating the idea of adding optional type annotations. We demonstrate that low-level optimizations rarely accelerate the program enough to pay back the investment into performing them in an optionally typed language. Our experiments and data demonstrate that high-level optimizations are required to improve performance by any significant amount.

References

  1. ActionScript 3.0 Overview - Adobe Developer Connection - http://www.adobe.com/devnet/actionscript/articles/actionscript3_overview.html.Google ScholarGoogle Scholar
  2. dynamic (C# Reference) - http://msdn.microsoft.com/en-us/library/dd264741.aspx#Y669.Google ScholarGoogle Scholar
  3. LIR - MDC - https://developer.mozilla.org/en/Nanojit/LIR.Google ScholarGoogle Scholar
  4. LLVM Assembly Language Reference Manual - http://llvm.org/docs/LangRef.html.Google ScholarGoogle Scholar
  5. NanoJIT - MDC - https://developer.mozilla.org/En/Nanojit.Google ScholarGoogle Scholar
  6. Open Source Framework, Web Application Software Development - Flex - Adobe - http://www.adobe.com/products/flex/.Google ScholarGoogle Scholar
  7. Proposed ECMAScript 4 Edition - Language Overview - http://www.ecmascript.org/es4/spec/overview.pdf.Google ScholarGoogle Scholar
  8. Standard ECMA-262. 3rd Edition - December 1999. http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-362.pdf.Google ScholarGoogle Scholar
  9. Sunspider JavaScript Benchmark - http://www.webkit.org/perf/sunspider/sunspider.html.Google ScholarGoogle Scholar
  10. Tamarin - MDC - https://developer.mozilla.org/en/Tamarin.Google ScholarGoogle Scholar
  11. The WebKit Open Source Project - http://webkit.org/.Google ScholarGoogle Scholar
  12. unladen-swallow - Project Hosting on Google Code - http://code.google.com/p/unladen-swallow/.Google ScholarGoogle Scholar
  13. Unladen Swallow Retrospective - QINSB is not a Software Blog - http://qinsb.blogspot.com/2011/03/unladen-swallow-retrospective.html.Google ScholarGoogle Scholar
  14. V8 - Project Hosting on Google Code - http://code.google.com/p/v8/.Google ScholarGoogle Scholar
  15. V8 Benchmark Suite - http://v8.googlecode.com/svn/data/benchmarks/current/run.html.Google ScholarGoogle Scholar
  16. M. Abadi, L. Cardelli, B. Pierce, and G. Plotkin. Dynamic Typing in a Statically Typed Language. ACM Transactions on Programming Languages and Systems, 13(2):237--268, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. O. Agesen and U. Hölzle. Type Feedback vs. Concrete Type Inference: A Comparison of Optimization Techniques for Object-Oriented Languages. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 91--107. ACM, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. B. Alpern, C. Attanasio, J. Barton, M. Burke, P. Cheng, J. Choi, A. Cocchi, S. Fink, D. Grove, M. Hind, et al. The Jalapeno Virtual Machine. IBM Systems Journal, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. C. Anderson, P. Giannini, and S. Drossopoulou. Towards Type Inference for JavaScript. In Proceedings of the European Conference on Object-Oriented Programming, pages 428--452. Springer, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. G. Bracha. Pluggable Type Systems. In OOPSLA Workshop on Revival of Dynamic Languages, 2004.Google ScholarGoogle Scholar
  21. C. Chambers and D. Ungar. Customization: Optimizing Compiler Technology for SELF, a Dynamically-Typed Object-Oriented Programming Language. In Proceedings of the Symposium on Interpreters and Interpretive Techniques, pages 146--160. ACM, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. C. Click and K. Cooper. Combining Analyses, Combining Optimizations. ACM Transactions on Programming Languages and Systems, 17(2):181--196, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. R. Cytron, J. Ferrante, B. Rosen, M. Wegman, and F. Zadeck. Efficiently Computing Static Single Assignment Form and the Control Dependence Graph. ACM Transactions on Programming Languages and Systems, 13(4):451--490, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. L. Damas and R. Milner. Principal Type-Schemes for Functional Programs. In Proceedings of the ACM SIGPLAN Symposium on Principles of Programming Languages, pages 207--212. ACM, 1982. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. A. Gal, M. Bebenita, M. Chang, and M. Franz. Making the Compilation "Pipeline" Explicit: Dynamic Compilation Using Trace Tree Serialization. Technical Report CS-TR-07-12, 2008.Google ScholarGoogle Scholar
  26. A. Gal, B. Eich, M. Shaver, D. Anderson, D. Mandelin, M. Haghighat, B. Kaplan, G. Hoare, B. Zbarsky, J. Orendorff, et al. Trace-Based Just-In-Time Type Specialization for Dynamic Languages. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 465--478. ACM, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. C. Garrett, J. Dean, D. Grove, and C. Chambers. Measurement and Application of Dynamic Receiver Class Distributions. Technical Report CSE-TR-94-03-05, University of Washington, 1994.Google ScholarGoogle Scholar
  28. J. Gronski, K. Knowles, A. Tomb, S. Freund, and C. Flanagan. Sage: Hybrid Checking for Flexible Specifications. In Scheme and Functional Programming Workshop, pages 93--104, 2006.Google ScholarGoogle Scholar
  29. U. Hölzle, C. Chambers, and D. Ungar. Optimizing Dynamically-Typed Object-Oriented Languages With Polymorphic Inline Caches. In Proceedings of the European Conference on Object-Oriented Programming, pages 21--38. Springer, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. U. Hölzle and D. Ungar. Optimizing Dynamically-Dispatched Calls with Run-Time Type Feedback. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 326--336. ACM, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. T. Kotzmann, C. Wimmer, H. Mössenböck, T. Rodriguez, K. Russell, and D. Cox. Design of the Java HotSpot#8482; Client Compiler for Java 6. ACM Transactions on Architecture and Code Optimization, 5(1):1--32, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. 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, pages 75--. Published by the IEEE Computer Society, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. H. Lee, D. von Dincklage, A. Diwan, and J. Moss. Understanding the Behavior of Compiler Optimizations. Software: Practice and Experience, 36(8):835--844, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. R. Milner. A Theory of Type Polymorphism in Programming. Journal of Computer and System Sciences, 17(3):348--375, 1978.Google ScholarGoogle ScholarCross RefCross Ref
  35. M. Odersky, P. Altherr, V. Cremet, B. Emir, S. Maneth, S. Micheloud, N. Mihaylov, M. Schinz, E. Stenman, and M. Zenger. An overview of the scala programming language. Technical report, 2004.Google ScholarGoogle Scholar
  36. J. Palsberg and M. Schwartzbach. Object-Oriented Type Inference. Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 146--161, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. M. Poletto and V. Sarkar. Linear Scan Register Allocation. ACM Transactions on Programming Languages and Systems, 21(5):895--913, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. J. Siek and W. Taha. Gradual Typing for Functional Languages. In Scheme and Functional Programming, pages 81--92, 2006.Google ScholarGoogle Scholar
  39. J. Siek and W. Taha. Gradual Typing for Objects. In Proceedings of the European Conference on Object-Oriented Programming, pages 2--27. Springer, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. J. Siek and M. Vachharajani. Gradual Typing with Unification-Based Inference. In Proceedings of the 2008 Symposium on Dynamic Languages, pages 7:1--7:12. ACM, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. S. Thatte. Quasi-Static Typing. In Proceedings of the 17th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 207--212. ACM, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. S. Thatte. Type Inference with Partial Types. In Theoretical Computer Science, pages 615--629. Elsevier, 1994.Google ScholarGoogle Scholar
  43. P. Thiemann. Towards a Type System for Analyzing Javascript Programs. In Programming Languages and Systems, pages 408--422. Springer, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. S. Tobin-Hochstadt and M. Felleisen. Interlanguage Migration: From Scripts to Programs. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 964--974. ACM, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. S. Tobin-Hochstadt and M. Felleisen. The Design and Implementation of Typed Scheme. In Proceedings of the ACM SIGPLAN Symposium on Principles of Programming Languages, pages 395--406. ACM, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. The impact of optional type information on jit compilation of dynamically typed languages

    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

    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!