Compiling scheme to JVM bytecode:: a performance study

We have added a Java virtual machine (henceforth JVM) bytecode generator to the optimizing Scheme-to-C compiler Bigloo. We named this new compiler BiglooJVM. We have used this new compiler to evaluate how suitable the JVM bytecode is as a target for compiling strict functional languages such as Scheme. In this paper, we focus on the performance issue. We have measured the execution time of many Scheme programs when compiled to C and when compiled to JVM. We found that for each benchmark, at least one of our hardware platforms ran the BiglooJVM version in less than twice the time taken by the Bigloo version. In order to deliver fast programs the generated JVM bytecode must be carefully crafted in order to benefit from the speedup of just-in-time compilers.

[1]  Andreas Krall,et al.  Efficient JavaVM just-in-time compilation , 1998, Proceedings. 1998 International Conference on Parallel Architectures and Compilation Techniques (Cat. No.98EX192).

[2]  Ali-Reza Adl-Tabatabai,et al.  Fast, effective code generation in a just-in-time Java compiler , 1998, PLDI.

[3]  Olin Shivers,et al.  Control flow analysis in scheme , 1988, PLDI '88.

[4]  Rafael Dueire Lins,et al.  Benchmarking implementations of functional languages with ‘Pseudoknot’, a float-intensive benchmark , 1996, Journal of Functional Programming.

[5]  Nitsan Seniak Theorie et pratique de sqil, un langage intermediaire pour la compilation des langages fonctionnels , 1991 .

[6]  Troy Downing,et al.  Java Virtual Machine , 1997 .

[7]  Matthew Arnold,et al.  Adaptive optimization in the Jalapeño JVM , 2000, OOPSLA '00.

[8]  John C. Gyllenhaal,et al.  Java bytecode to native code translation: the Caffeine prototype and preliminary results , 1996, Proceedings of the 29th Annual IEEE/ACM International Symposium on Microarchitecture. MICRO 29.

[9]  Nick Benton,et al.  Compiling standard ML to Java bytecodes , 1998, ICFP '98.

[10]  Manuel Serrano Inline Expansion: When and How? , 1997, PLILP.

[11]  Manuel Serrano Control flow analysis: a functional languages compilation paradigm , 1995, SAC '95.

[12]  Gary Sevitsky,et al.  Visualizing reference patterns for solving memory leaks in Java , 1999, Concurr. Pract. Exp..

[13]  Per Bothner,et al.  Kawa: compiling scheme to java , 1998 .

[14]  Jens Palsberg,et al.  Reducing loads and stores in stack architectures , 2000 .

[15]  Laurie J. Hendren,et al.  SableVM: A Research Framework for the Efficient Execution of Java Bytecode , 2001, Java Virtual Machine Research and Technology Symposium.

[16]  Pieter H. Hartel,et al.  Pseudoknot: A Float-Intensive Benchmark for Functional Compilers , 1994 .

[17]  Christian Queinnec,et al.  The influence of browsers on evaluators or, continuations to program web servers , 2000, ICFP '00.

[18]  Hans-Juergen Boehm,et al.  Garbage collection in an uncooperative environment , 1988, Softw. Pract. Exp..

[19]  B. J. Mailloux,et al.  Report on the Algorithmic Language , 1971 .

[20]  Marc Feeley,et al.  Compiling Higher-Order Languages into Fully Tail-Recursive Portable C , 1997 .

[21]  Toshiaki Yasue,et al.  Overview of the IBM Java Just-in-Time Compiler , 2000, IBM Syst. J..

[22]  Martin Odersky,et al.  Tail call elimination on the Java Virtual Machine , 2001, Electron. Notes Theor. Comput. Sci..

[23]  Marc Feeley,et al.  Storage use analysis and its applications , 1996, ICFP '96.

[24]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.

[25]  Appendix A Benchmarks , 2022 .

[26]  Henry G. Baker,et al.  CONS should not CONS its arguments, part II: Cheney on the M.T.A. , 1995, SIGP.

[27]  R. Kent Dybvig,et al.  Revised5 Report on the Algorithmic Language Scheme , 1986, SIGP.

[28]  David A. Gudeman,et al.  Representing Type Information in Dynamically Typed Languages , 1993 .

[29]  Urs Hölzle,et al.  Reconciling responsiveness with performance in pure object-oriented languages , 1996, TOPL.

[30]  Pierre Weis,et al.  Bigloo: A Portable and Optimizing Compiler for Strict Functional Languages , 1995, SAS.

[31]  Urs Hölzle,et al.  Adaptive optimization for self: reconciling high performance with exploratory programming , 1994 .

[32]  David Wakeling,et al.  Compiling lazy functional programs for the Java Virtual Machine , 1999, Journal of Functional Programming.

[33]  Xavier Leroy,et al.  Unboxed objects and polymorphic typing , 1992, POPL '92.

[34]  Peter Lee,et al.  No assembly required: compiling standard ML to C , 1992, LOPL.