[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
10.1145/2384616.2384631acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
research-article

On the benefits and pitfalls of extending a statically typed language JIT compiler for dynamic scripting languages

Published: 19 October 2012 Publication History

Abstract

Whenever the need to compile a new dynamically typed language arises, an appealing option is to repurpose an existing statically typed language Just-In-Time (JIT) compiler (repurposed JIT compiler). Existing repurposed JIT compilers (RJIT compilers), however, have not yet delivered the hoped-for performance boosts. The performance of JVM languages, for instance, often lags behind standard interpreter implementations. Even more customized solutions that extend the internals of a JIT compiler for the target language compete poorly with those designed specifically for dynamically typed languages. Our own Fiorano JIT compiler is an example of this problem. As a state-of-the-art, RJIT compiler for Python, the Fiorano JIT compiler outperforms two other RJIT compilers (Unladen Swallow and Jython), but still shows a noticeable performance gap compared to PyPy, today's best performing Python JIT compiler. In this paper, we discuss techniques that have proved effective in the Fiorano JIT compiler as well as limitations of our current implementation. More importantly, this work offers the first in-depth look at benefits and limitations of the repurposed JIT compiler approach. We believe the most common pitfall of existing RJIT compilers is not focusing sufficiently on specialization, an abundant optimization opportunity unique to dynamically typed languages. Unfortunately, the lack of specialization cannot be overcome by applying traditional optimizations.

References

[1]
JavaScript. http://www.ecma.ch/ecma1/STAND/ECMA-262.HTM.
[2]
CPython. http://www.python.org/.
[3]
Google V8 JavaScript engine. URL http://code.google.com/p/v8/.
[4]
HipHop project. https://github.com/facebook/hiphop-php/wiki/.
[5]
IronPython. http://ironpython.codeplex.com/.
[6]
JRuby. http://jruby.org/.
[7]
Jython. http://www.jython.org/.
[8]
Python language. http://www.python.org.
[9]
Rhino. http://www.mozilla.org/rhino/.
[10]
Rubinius. http://rubini.us/.
[11]
Shootout: the computer language benchmarks. http://shootout.alioth.debian.org/.
[12]
SquirrelFish extreme JavaScript engine, 2008. http://webkit.org/blog/189/announcing-squirrelfish/.
[13]
Unladen-Swallow project, . http://code.google.com/p/unladen-swallow/wiki/.
[14]
Unladen-Swallow benchmarks, . http://code.google.com/p/unladen-swallow/wiki/Benchmarks.
[15]
M. Bebenita, F. Brandner, M. Fahndrich, F. Logozzo, W. Schulte, N. Tillmann, and H. Venter. SPUR: a trace-based JIT compiler for CIL. In Proceedings of ACM conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 708--725, 2010.
[16]
S. Behnel, R. Bradshaw, and D. S. Seljebotn. Cython. http://cython.org/.
[17]
C. F. Bolz, A. Cuni, M. Fijalkowski, and A. Rigo. Tracing the meta-level: PyPy's tracing JIT compiler. In Proceedings of the 4th workshop on the Implementation, Compilation, Optimization of Object-Oriented Languages and Programming Systems (ICOOOLPS), pages 18--25, 2009.
[18]
C. F. Bolz, A. Cuni, M. Fijalkowski, M. Leuschel, S. Pedroni, and A. Rigo. Allocation removal by partial evaluation in a tracing JIT. In Proceedings of the 20th ACM workshop on Partial Evaluation and Program Manipulation (PEPM), pages 43--52, 2011.
[19]
C. F. Bolz, A. Cuni, M. Fijalkowski, M. Leuschel, S. Pedroni, and A. Rigo. Runtime feedback in a meta-tracing JIT for efficient dynamic languages. In Proceedings of the 6th workshop on Implementation, Compilation, Optimization of Object-Oriented Languages, Programs and Systems (ICOOOLPS), 2011.
[20]
C. Chambers and D. Ungar. Making pure object-oriented languages practical. In Proceedings of ACM conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), volume 26, pages 1--15, 1991.
[21]
C. Chambers, D. Ungar, and E. Lee. An efficient implementation of self a dynamically-typed object-oriented language based on prototypes. In Proceedings of ACM conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 49--70, 1989.
[22]
M. Chang, B. Mathiske, E. Smith, A. Chaudhuri, A. Gal, M. Bebenita, C. Wimmer, and M. Franz. The impact of optional type information on JIT compilation of dynamically typed languages. In Proceedings of the 7th symposium on dynamic languages, pages 13--24, 2011.
[23]
J.-D. Choi, D. Grove, M. Hind, and V. Sarkar. Efficient and precise modeling of exceptions for the analysis of Java programs. In Proceedings of ACM workshop on program analysis for software tools and engineering, pages 21--31, 1999.
[24]
A. Gal, B. Eich, M. Shaver, D. Anderson, D. Mandelin, M. R. Haghighat, B. Kaplan, G. Hoare, B. Zbarsky, J. Orendorff, J. Ruderman, E. W. Smith, R. Reitmaier, M. Bebenita, M. Chang, and M. Franz. Trace-based Just-In-Time type specialization for dynamic languages. In Proceedings of ACM conference on Programming Language Design and Implementation (PLDI), pages 465--478, 2009.
[25]
C. Haubl and H. Mossenbock. Trace-based compilation for the Java HotSpot virtual machine. In Proceedings of ACM conference on the Principles and Practice of Programming in Java (PPPJ), pages 129--138, 2011.
[26]
A. Holkner and J. Harland. Evaluating the dynamic behaviour of Python applications. In Proceedings of the 33rd Australasian conference on computer science, pages 19--28, 2009.
[27]
U. Holzle and D. Ungar. A third generation Self implementation: Reconciling responsiveness with performance. In Proceedings of ACM conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), Oct. 1994.
[28]
U. Holzle, C. Chambers, and D. Ungar. Debugging optimized code with dynamic deoptimization. In Proceedings of ACM conference on Programming Language Design and Implementation (PLDI), June 1992.
[29]
K. Ishizaki, T. Ogasawara, J. Castanos, P. Nagpurkar, D. Edel-sohn, and T. Nakatani. Adding dynamically-typed language support to a statically-typed language compiler: performance evaluation, analysis, and tradeoffs. In Proceedings of conference on Virtual Execution Environments (VEE), pages 169--180, 2012.
[30]
P. G. Joisha. A principled approach to nondeferred reference-counting garbage collection. In Proceedings of conference on Virtual Execution Environments (VEE), pages 131--140, 2008.
[31]
C. Lattner and V. Adve. LLVM: A compilation frame-work for lifelong program analysis & transformation. In Proceedings of international symposium on Code Generation and Pptimization (CGO), Mar 2004.
[32]
N. Mostafa, C. Krintz, C. Cascaval, D. Edelsohn, P. Nag-purkar, and P. Wu. Understanding the potential of interpreter-based optimizations for Python. Technical Report 2010-14, UCSB, Jan 2010.
[33]
M. Pall. LuaJIT. http://luajit.org/.
[34]
J. Siek, S. Bharadwaj, and J. Baker. JVM summit: invokedynamic and Jython, 2011. http://wiki.jvmlangsummit.com/images/8/8d/Indy_and_Jython-Shashank_Bharadwaj.pdf.
[35]
V. Sundaresan, D. Maier, P. Ramarao, and M. Stoodley. Experiences with multi-threading and dynamic class loading in a Java Just-In-Time compiler. In Proceedings of international symposium on Code Generation and Pptimization (CGO), pages 87--97, 2006.
[36]
M. Tatsubori, A. Tozawa, T. Suzumura, S. Trent, and T. Onodera. Evaluation of a Just-In-Time compiler retrofitted for PHP. In Proceedings of conference on Virtual Execution Environments (VEE), pages 121--132, 2010.
[37]
P. Wu, S. Midkiff, J. Moreira, and M. Gupta. Efficient support for complex numbers in Java. In Proceedings of the ACM conference on Java grande, pages 109--118, 1999.
[38]
P. Wu, H. Hayashizaki, H. Inoue, and T. Nakatani. Reducing trace selection footprint for large-scale java applications without performance loss. In Proceedings of ACM conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 789--804, 2011.
[39]
H. Zhao. HipHop compiler for PHP: Transforming PHP into C++. http://www.stanford.edu/class/ee380/Abstracts/100505.html.

Cited By

View all
  • (2022)Generic go to go: dictionary-passing, monomorphisation, and hybridProceedings of the ACM on Programming Languages10.1145/35633316:OOPSLA2(1207-1235)Online publication date: 31-Oct-2022
  • (2021)Hiding in the Particles: When Return-Oriented Programming Meets Program Obfuscation2021 51st Annual IEEE/IFIP International Conference on Dependable Systems and Networks (DSN)10.1109/DSN48987.2021.00064(555-568)Online publication date: Jun-2021
  • (2020)Hidden inheritance: an inline caching design for TypeScript performanceProceedings of the ACM on Programming Languages10.1145/34282424:OOPSLA(1-29)Online publication date: 13-Nov-2020
  • Show More Cited By

Index Terms

  1. On the benefits and pitfalls of extending a statically typed language JIT compiler for dynamic scripting languages

      Recommendations

      Comments

      Please enable JavaScript to view thecomments powered by Disqus.

      Information & Contributors

      Information

      Published In

      cover image ACM Conferences
      OOPSLA '12: Proceedings of the ACM international conference on Object oriented programming systems languages and applications
      October 2012
      1052 pages
      ISBN:9781450315616
      DOI:10.1145/2384616
      • cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 47, Issue 10
        OOPSLA '12
        October 2012
        1011 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/2398857
        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: 19 October 2012

      Permissions

      Request permissions for this article.

      Check for updates

      Author Tags

      1. python
      2. scripting languages

      Qualifiers

      • Research-article

      Conference

      SPLASH '12
      Sponsor:

      Acceptance Rates

      Overall Acceptance Rate 268 of 1,244 submissions, 22%

      Upcoming Conference

      Contributors

      Other Metrics

      Bibliometrics & Citations

      Bibliometrics

      Article Metrics

      • Downloads (Last 12 months)14
      • Downloads (Last 6 weeks)4
      Reflects downloads up to 01 Jan 2025

      Other Metrics

      Citations

      Cited By

      View all
      • (2022)Generic go to go: dictionary-passing, monomorphisation, and hybridProceedings of the ACM on Programming Languages10.1145/35633316:OOPSLA2(1207-1235)Online publication date: 31-Oct-2022
      • (2021)Hiding in the Particles: When Return-Oriented Programming Meets Program Obfuscation2021 51st Annual IEEE/IFIP International Conference on Dependable Systems and Networks (DSN)10.1109/DSN48987.2021.00064(555-568)Online publication date: Jun-2021
      • (2020)Hidden inheritance: an inline caching design for TypeScript performanceProceedings of the ACM on Programming Languages10.1145/34282424:OOPSLA(1-29)Online publication date: 13-Nov-2020
      • (2018)Hop, Skip, & JumpACM SIGPLAN Notices10.1145/3296975.318641253:3(1-16)Online publication date: 25-Mar-2018
      • (2018)Estimating Collective Attention toward a Public DisplayACM Transactions on Interactive Intelligent Systems10.1145/32307158:3(1-34)Online publication date: 24-Jul-2018
      • (2018)Hop, Skip, & JumpProceedings of the 14th ACM SIGPLAN/SIGOPS International Conference on Virtual Execution Environments10.1145/3186411.3186412(1-16)Online publication date: 25-Mar-2018
      • (2017)Pareto Governors for Energy-Optimal ComputingACM Transactions on Architecture and Code Optimization10.1145/304668214:1(1-25)Online publication date: 13-Mar-2017
      • (2017)ExceptionizationACM Transactions on Architecture and Code Optimization10.1145/304668114:1(1-25)Online publication date: 14-Apr-2017
      • (2017)LDACM Transactions on Architecture and Code Optimization10.1145/304667814:1(1-25)Online publication date: 21-Mar-2017
      • (2016)Polymorphic bytecode instrumentationSoftware—Practice & Experience10.1002/spe.238546:10(1351-1380)Online publication date: 1-Oct-2016
      • 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

      Media

      Figures

      Other

      Tables

      Share

      Share

      Share this Publication link

      Share on social media