skip to main content
10.1145/2047849.2047853acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
research-article

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

Published: 24 October 2011 Publication History

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.
[2]
dynamic (C# Reference) - http://msdn.microsoft.com/en-us/library/dd264741.aspx#Y669.
[3]
LIR - MDC - https://developer.mozilla.org/en/Nanojit/LIR.
[4]
LLVM Assembly Language Reference Manual - http://llvm.org/docs/LangRef.html.
[5]
NanoJIT - MDC - https://developer.mozilla.org/En/Nanojit.
[6]
Open Source Framework, Web Application Software Development - Flex - Adobe - http://www.adobe.com/products/flex/.
[7]
Proposed ECMAScript 4 Edition - Language Overview - http://www.ecmascript.org/es4/spec/overview.pdf.
[8]
Standard ECMA-262. 3rd Edition - December 1999. http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-362.pdf.
[9]
Sunspider JavaScript Benchmark - http://www.webkit.org/perf/sunspider/sunspider.html.
[10]
Tamarin - MDC - https://developer.mozilla.org/en/Tamarin.
[11]
The WebKit Open Source Project - http://webkit.org/.
[12]
unladen-swallow - Project Hosting on Google Code - http://code.google.com/p/unladen-swallow/.
[13]
Unladen Swallow Retrospective - QINSB is not a Software Blog - http://qinsb.blogspot.com/2011/03/unladen-swallow-retrospective.html.
[14]
V8 - Project Hosting on Google Code - http://code.google.com/p/v8/.
[15]
V8 Benchmark Suite - http://v8.googlecode.com/svn/data/benchmarks/current/run.html.
[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.
[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.
[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.
[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.
[20]
G. Bracha. Pluggable Type Systems. In OOPSLA Workshop on Revival of Dynamic Languages, 2004.
[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.
[22]
C. Click and K. Cooper. Combining Analyses, Combining Optimizations. ACM Transactions on Programming Languages and Systems, 17(2):181--196, 1995.
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[34]
R. Milner. A Theory of Type Polymorphism in Programming. Journal of Computer and System Sciences, 17(3):348--375, 1978.
[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.
[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.
[37]
M. Poletto and V. Sarkar. Linear Scan Register Allocation. ACM Transactions on Programming Languages and Systems, 21(5):895--913, 1999.
[38]
J. Siek and W. Taha. Gradual Typing for Functional Languages. In Scheme and Functional Programming, pages 81--92, 2006.
[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.
[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.
[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.
[42]
S. Thatte. Type Inference with Partial Types. In Theoretical Computer Science, pages 615--629. Elsevier, 1994.
[43]
P. Thiemann. Towards a Type System for Analyzing Javascript Programs. In Programming Languages and Systems, pages 408--422. Springer, 2005.
[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.
[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.

Cited By

View all
  • (2016)Is sound gradual typing dead?ACM SIGPLAN Notices10.1145/2914770.283763051:1(456-468)Online publication date: 11-Jan-2016
  • (2016)Is sound gradual typing dead?Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages10.1145/2837614.2837630(456-468)Online publication date: 11-Jan-2016
  • (2016)Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming LanguagesundefinedOnline publication date: 11-Jan-2016
  • Show More Cited By

Index Terms

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

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    DLS '11: Proceedings of the 7th symposium on Dynamic languages
    October 2011
    114 pages
    ISBN:9781450309394
    DOI:10.1145/2047849
    • General Chair:
    • Theo D'Hondt
    • cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 47, Issue 2
      DLS '11
      February 2012
      103 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/2168696
      Issue’s Table of Contents
    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 ACM 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: 24 October 2011

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. actionscript
    2. dynamic compilation
    3. javascript type speculation
    4. optionally typed languages
    5. tamarin
    6. type inference

    Qualifiers

    • Research-article

    Conference

    SPLASH '11
    Sponsor:

    Acceptance Rates

    Overall Acceptance Rate 32 of 77 submissions, 42%

    Upcoming Conference

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)12
    • Downloads (Last 6 weeks)0
    Reflects downloads up to 08 Mar 2025

    Other Metrics

    Citations

    Cited By

    View all
    • (2016)Is sound gradual typing dead?ACM SIGPLAN Notices10.1145/2914770.283763051:1(456-468)Online publication date: 11-Jan-2016
    • (2016)Is sound gradual typing dead?Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages10.1145/2837614.2837630(456-468)Online publication date: 11-Jan-2016
    • (2016)Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming LanguagesundefinedOnline publication date: 11-Jan-2016
    • (2015)Pycket: a tracing JIT for a functional languageACM SIGPLAN Notices10.1145/2858949.278474050:9(22-34)Online publication date: 29-Aug-2015
    • (2015)Pycket: a tracing JIT for a functional languageProceedings of the 20th ACM SIGPLAN International Conference on Functional Programming10.1145/2784731.2784740(22-34)Online publication date: 29-Aug-2015
    • (2014)Advantages of Deferred Approach for Time-Critical TasksInformatica10.15388/Informatica.2014.2425:3(467-484)Online publication date: 1-Jul-2014
    • (2013)VolitionACM SIGPLAN Notices10.1145/2499368.245117448:4(535-548)Online publication date: 16-Mar-2013
    • (2013)Wait-n-GoTMACM SIGPLAN Notices10.1145/2499368.245117348:4(521-534)Online publication date: 16-Mar-2013
    • (2013)OWLACM SIGPLAN Notices10.1145/2499368.245115848:4(395-406)Online publication date: 16-Mar-2013
    • (2012)Exploiting inter-sequence correlations for program behavior predictionACM SIGPLAN Notices10.1145/2398857.238467847:10(851-866)Online publication date: 19-Oct-2012
    • 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

    Figures

    Tables

    Media

    Share

    Share

    Share this Publication link

    Share on social media