JRuby+Truffle. Kevin Menard. Chris Seaton. Benoit Daloze. A tour through a new Ruby Oracle Oracle Labs

Size: px
Start display at page:

Download "JRuby+Truffle. Kevin Menard. Chris Seaton. Benoit Daloze. A tour through a new Ruby Oracle Oracle Labs"

Transcription

1

2 JRuby+Truffle A tour through a new Ruby implementahon Chris Oracle Labs Benoit JKU Linz Kevin Oracle Labs Ruby logo copyright (c) 2006, Yukihiro Matsumoto, licensed under the terms of the CreaHve Commons AYribuHon- ShareAlike 2.5 agreement Copyright 2015, Oracle and/or its affiliates. All rights reserved.

3 Safe Harbor Statement The following is intended to provide some insight into a line of research in Oracle Labs. It is intended for informahon purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or funchonality, and should not be relied upon in making purchasing decisions. Oracle reserves the right to alter its development plans and prachces at any Hme, and the development, release, and Hming of any features or funchonality described in connechon with any Oracle product or service remains at the sole discrehon of Oracle. Any views expressed in this presentahon are my own and do not necessarily reflect the views of Oracle. Copyright 2015, Oracle and/or its affiliates. All rights reserved. 3

4 What is the big idea? Copyright 2015, Oracle and/or its affiliates. All rights reserved. 4

5 Current situation Prototype a new language Parser and language work to build syntax tree (AST), AST Interpreter Write a real VM In C/C++, shll using AST interpreter, spend a lot of Hme implemenhng runhme system, GC, People start using it People complain about performance Define a bytecode format and write bytecode interpreter Performance is shll bad Write a JIT compiler Improve the garbage collector Copyright 2015, Oracle and/or its affiliates. All rights reserved. 5

6 Current situation How it should be Prototype a new language Parser and language work to build syntax tree (AST), AST Interpreter Write a real VM In C/C++, shll using AST interpreter, spend a lot of Hme implemenhng runhme system, GC, Prototype a new language in Java Parser and language work to build syntax tree (AST) Execute using AST interpreter People start using it And it is already fast People start using it People complain about performance Define a bytecode format and write bytecode interpreter Performance is shll bad Write a JIT compiler Improve the garbage collector Copyright 2015, Oracle and/or its affiliates. All rights reserved. 6

7 What are Truffle and Graal? Copyright 2015, Oracle and/or its affiliates. All rights reserved. 7

8 Truffle: a framework for wrihng AST interpreters for languages in Java Graal: a dynamic compiler (JIT) for Java, wriyen in Java, as a Java library Copyright 2015, Oracle and/or its affiliates. All rights reserved. 8

9 U Node Rewriting for Profiling Feedback G Compilation using Partial Evaluation G U U Node Transitions I G I G U U U Uninitialized Integer I I I I I AST Interpreter Uninitialized Nodes S String G D Double Generic AST Interpreter Rewritten Nodes Compiled Code T. Würthinger, C. Wimmer, A. Wöß, L. Stadler, G. Duboscq, C. Humer, G. Richards, D. Simon, and M. Wolczko. One VM to rule them all. In Proceedings of Onward!, Copyright 2015, Oracle and/or its affiliates. All rights reserved. 9

10 codon.com/compilers- for- free PresentaHon, by Tom Stuart, licensed under a CreaHve Commons AYribuHon ShareAlike 3.0 Copyright 2015, Oracle and/or its affiliates. All rights reserved. 10

11 Frequently executed call Copyright 2015, Oracle and/or its affiliates. All rights reserved. 11

12 Copyright 2015, Oracle and/or its affiliates. All rights reserved. 12

13 Deoptimization to AST Interpreter G Node Rewriting to Update Profiling Feedback G Recompilation using Partial Evaluation G G I G I G D G D G I I I D I I I D T. Würthinger, C. Wimmer, A. Wöß, L. Stadler, G. Duboscq, C. Humer, G. Richards, D. Simon, and M. Wolczko. One VM to rule them all. In Proceedings of Onward!, Copyright 2015, Oracle and/or its affiliates. All rights reserved. 13

14 John Tenniel illustrahons public domain in the UK and US Copyright 2015, Oracle and/or its affiliates. All rights reserved. 14

15 John Tenniel illustrahons public domain in the UK and US Copyright 2015, Oracle and/or its affiliates. All rights reserved. 15

16 t1 = Fixnum(a) + Fixnum(b) if t1.overflowed? t1 = Bignum(a) + Bignum(b) t2 = Bignum(t1) + Bignum(c) else t2 = Fixnum(t1) + Fixnum(c) if t2.overflowed? t2 = Bignum(t1) + Bignum(c) end end Copyright 2015, Oracle and/or its affiliates. All rights reserved. 16

17 t1 = Fixnum(a) + Fixnum(b) deoptimize! if t1.overflowed? t2 = Fixnum(t1) + Fixnum(c) deoptimize! if t2.overflowed? Copyright 2015, Oracle and/or its affiliates. All rights reserved. 17

18 Guest Language Bytecode JVM Copyright 2015, Oracle and/or its affiliates. All rights reserved. 18

19 Guest Language Java IR, machine code cache, invalidahon and deophmisahon, ophmisahon phases, replacements, etc etc Graal VM Copyright 2015, Oracle and/or its affiliates. All rights reserved. 19

20 Guest Language Truffle AST interpreter Graal VM Copyright 2015, Oracle and/or its affiliates. All rights reserved. 20

21 A tour through Ruby, Truffle and Graal Copyright 2015, Oracle and/or its affiliates. All rights reserved. 21

22 SpecializaHons class Array def [](index=fixnum()) # return element at index end def [](index=fixnum(), num=fixnum()) # return num elements starting at index end def [](range=range()) # return elements from range.start to range.end end def [](index) # coerce index and dispatch end B. Shirai, Rubinius 3.0, Part 5, The Language, hyp://rubini.us/2014/11/14/rubinius part- 5- the- language/ Copyright 2015, Oracle and/or its affiliates. All rights reserved. 22

23 SpecializaHons def clamp(num, min, max) [min, num, max].sort[1] end chunky_png and psd.rb, Willem van Bergen, Ryan LeFevre, Kelly SuYon, Layer Vault, Floorplanner et al Copyright 2015, Oracle and/or its affiliates. All rights reserved. 23

24 From Fixnum#+ to 0x03 0x70 Copyright 2015, Oracle and/or its affiliates. All rights reserved. 24

25 Digging through ObjectSpace and deophmizahon l DeopHmize l Get a consistent view of memory: safepoints l Find all reachable objects l Iterate through them Copyright 2015, Oracle and/or its affiliates. All rights reserved. 25

26 Digging through ObjectSpace and deophmizahon public Map<Long, RubyBasicObject> collectliveobjects() { liveobjects = new HashMap<>(); visitor = new ObjectGraphVisitor() public boolean visit(rubybasicobject object) { return liveobjects.put(object.getobjectid(), object) == null; } }; context.getsafepointmanager().pauseallthreadsandexecute(new Consumer<RubyThread>() { public void accept(rubythread currentthread) { synchronized (liveobjects) { visitor.visit(currentthread); context.getcorelibrary().getglobalvariablesobject().visitobjectgraph(visitor); context.getcorelibrary().getmainobject().visitobjectgraph(visitor); context.getcorelibrary().getobjectclass().visitobjectgraph(visitor); visitcallstack(visitor); } } } return Collections.unmodifiableMap(liveObjects); Copyright 2015, Oracle and/or its affiliates. All rights reserved. 26

27 Does it really implement Ruby? Copyright 2015, Oracle and/or its affiliates. All rights reserved. 27

28 93% RubySpec language specs Brian Shirai et al Copyright 2015, Oracle and/or its affiliates. All rights reserved. 28

29 24% RubySpec core library specs Brian Shirai et al Copyright 2015, Oracle and/or its affiliates. All rights reserved. 29

30 Method invalidahon #send #binding Float Threads Frame- local variables C extensions Encodings ObjectSpace Regexp Thread#raise #eval Fixnum to Bignum promohon set_trace_func Proc#binding Concurrency Constant invalidahon Debugging Closures Copyright 2015, Oracle and/or its affiliates. All rights reserved. 30

31 Method invalidahon #send #binding Float Threads Frame- local variables C extensions Encodings ObjectSpace Regexp Thread#raise #eval Fixnum to Bignum promohon set_trace_func Proc#binding Concurrency Constant invalidahon Debugging Closures Copyright 2015, Oracle and/or its affiliates. All rights reserved. 31

32 How fast is it? Copyright 2015, Oracle and/or its affiliates. All rights reserved. 32

33 Mandelbrot Speedup RelaHve to MRI Copyright 2015, Oracle and/or its affiliates. All rights reserved. 33

34 Copyright 2015, Oracle and/or its affiliates. All rights reserved. 34

35 chunky_png and psd.rb Willem van Bergen, Ryan LeFevre, Kelly SuYon, Layer Vault, Floorplanner et al Ruby logo copyright (c) 2006, Yukihiro Matsumoto, licensed under the terms of the CreaHve Commons AYribuHon- ShareAlike 2.5 agreement Copyright 2015, Oracle and/or its affiliates. All rights reserved. 35

36 Copyright 2015, Oracle and/or its affiliates. All rights reserved. 36

37 Copyright 2015, Oracle and/or its affiliates. All rights reserved. 37

38 github.com/jruby/bench9000 Copyright 2015, Oracle and/or its affiliates. All rights reserved. 38

39 How will we solve startup Hme, memory footprint and the JVM dependency? Copyright 2015, Oracle and/or its affiliates. All rights reserved. 39

40 Static Analysis Ahead-of-Time Compilation Java ApplicaHon JDK Substrate VM IniHal Heap Machine Code OS All Java classes from applicahon, JDK, and Substrate VM Reachable methods, fields, and classes ApplicaHon running without compilahon or class loading Copyright 2015, Oracle and/or its affiliates. All rights reserved. 40

41 [msec] Execution Time [MByte] Memory Footprint MRI JRuby Truffle on JVM 14 Truffle on SVM MRI JRuby Truffle on JVM 9 Truffle on SVM Copyright 2015, Oracle and/or its affiliates. All rights reserved. 41

42 How do we implement C extensions? Copyright 2015, Oracle and/or its affiliates. All rights reserved. 42

43 Copyright 2015, Oracle and/or its affiliates. All rights reserved. 43

44 Copyright 2015, Oracle and/or its affiliates. All rights reserved. 44

45 Mean Speedup Relative to MRI Without C Extension (s/s) MRI With C Extension Rubinius With C Extension JRuby With C Extension JRuby+Truffle With C Extension JRuby+Truffle With C Extension (No Inline) Copyright 2015, Oracle and/or its affiliates. All rights reserved. 45

46 How does it build on other projects? Copyright 2015, Oracle and/or its affiliates. All rights reserved. 46

47 Lexer, parser Strings, regexps, IO Command line Build and distribuhon infrastructure Cannot re- use more of the core library due to very different approaches The language design The parts of the standard library wriyen in Ruby Considering trying to use some of the C code Parts of the core library Parts of the standard library RubySpec We have our own implementahons of the Rubinius primihves JRuby logo copyright (c) Tony Price 2011, licensed under the terms of the CreaHve Commons AYribuHon- NoDerivs 3.0 Unported (CC BY- ND 3.0) Ruby logo copyright (c) 2006, Yukihiro Matsumoto, licensed under the terms of the CreaHve Commons AYribuHon- ShareAlike 2.5 agreement Rubinius logo licensed under the terms of the CreaHve Commons AYribuHon- NoDerivs 3.0 Unported Copyright 2015, Oracle and/or its affiliates. All rights reserved. 47

48 Copyright 2015, Oracle and/or its affiliates. All rights reserved. 48

49 What other big ideas do we have? Copyright 2015, Oracle and/or its affiliates. All rights reserved. 49

50 Wrapping up Copyright 2015, Oracle and/or its affiliates. All rights reserved. 50

51 M. Grimmer, C. Seaton, T. Würthinger, H. Mössenböck. Dynamically Composing Languages in a Modular Way: SupporEng C Extensions for Dynamic Languages. In Proceedings of the 14th InternaHonal Conference on Modularity, 2015 (to appear) A. Wöß, C. Wirth, D. BoneYa, C. Seaton, C. Humer, and H. Mössenböck. An object storage model for the Truffle language implementaeon framework. In Proceedings of the InternaHonal Conference on Principles and PracHces of Programming on the Java Pla orm (PPPJ), C. Seaton, M. L. Van De Vanter, and M. Haupt. Debugging at full speed. In Proceedings of the 8th Workshop on Dynamic Languages and ApplicaHons (DYLA), 2014 T. Würthinger, C. Wimmer, A. Wöß, L. Stadler, G. Duboscq, C. Humer, G. Richards, D. Simon, M. Wolczko. One VM to Rule Them All. In Proceedings of Onward! T. Würthinger, A. Wöß, L. Stadler, G. Duboscq, D. Simon, C. Wimmer. Self- OpEmizing AST Interpreters. In Proceedings of the Dynamic Languages Symposium (DLS), 2012 Copyright 2015, Oracle and/or its affiliates. All rights reserved. 51

52 #jruby @nirvdrum Copyright 2015, Oracle and/or its affiliates. All rights reserved. 52

53 Safe Harbor Statement The preceding is intended to provide some insight into a line of research in Oracle Labs. It is intended for informahon purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or funchonality, and should not be relied upon in making purchasing decisions. Oracle reserves the right to alter its development plans and prachces at any Hme, and the development, release, and Hming of any features or funchonality described in connechon with any Oracle product or service remains at the sole discrehon of Oracle. Any views expressed in this presentahon are my own and do not necessarily reflect the views of Oracle. Copyright 2015, Oracle and/or its affiliates. All rights reserved. 53

54 Copyright 2015, Oracle and/or its affiliates. All rights reserved. 54

55

Ruby. JRuby+Truffle and the to JITs. Chris Oracle Labs

Ruby. JRuby+Truffle and the to JITs. Chris Oracle Labs John Tenniel illustra@ons public domain in the UK and US Deop@mizing Ruby JRuby+Truffle and the an@dote to JITs Chris Seaton @ChrisGSeaton Oracle Labs Copyright 2014, Oracle and/or its affiliates. All

More information

Debugging at Full Speed

Debugging at Full Speed Oracle Labs Document 2014-0221 Debugging at Full Speed Instrumen)ng Truffle- implemented Programs Michael L. Van De Vanter Oracle Labs, VM Research Group July 30, 2014 2014 JVM Language Summit Santa Clara,

More information

JRuby+Truffle. Why it s important to optimise the tricky parts. Chris Seaton Research Manager Oracle Labs 2 June 2016

JRuby+Truffle. Why it s important to optimise the tricky parts. Chris Seaton Research Manager Oracle Labs 2 June 2016 The Ruby Logo is Copyright (c) 2006, Yukihiro Matsumoto. It is licensed under the terms of the Creative Commons Attribution-ShareAlike 2.5 agreement. JRuby+Truffle Why it s important to optimise the tricky

More information

Faster Ruby and JS with Graal/Truffle

Faster Ruby and JS with Graal/Truffle The Ruby Logo is Copyright (c) 2006, Yukihiro Matsumoto. It is licensed under the terms of the Creative Commons Attribution-ShareAlike 2.5 agreement. Faster Ruby and JS with Graal/Truffle Chris Seaton

More information

Copyright 2014 Oracle and/or its affiliates. All rights reserved.

Copyright 2014 Oracle and/or its affiliates. All rights reserved. Copyright 2014 Oracle and/or its affiliates. All rights reserved. On the Quest Towards Fastest (Java) Virtual Machine on the Planet! @JaroslavTulach Oracle Labs Copyright 2015 Oracle and/or its affiliates.

More information

Guilt Free Ruby on the JVM

Guilt Free Ruby on the JVM The Ruby logo is Copyright 2006, Yukihiro Matsumoto. It is licensed under the terms of the Creative Commons Attribution-ShareAlike 2.5 License agreement. Guilt Free Ruby on the JVM Forgetting Conventional

More information

Truffle A language implementation framework

Truffle A language implementation framework Truffle A language implementation framework Boris Spasojević Senior Researcher VM Research Group, Oracle Labs Slides based on previous talks given by Christian Wimmer, Christian Humer and Matthias Grimmer.

More information

Using LLVM and Sulong for Language C Extensions

Using LLVM and Sulong for Language C Extensions Using LLVM and Sulong for Language C Extensions Chris Seaton Research Manager VM Research Group Oracle Labs Manuel Rigger, Matthias Grimmer JKU Linz Copyright 2016, Oracle and/or its affiliates. All rights

More information

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

Copyright 2012, Oracle and/or its affiliates. All rights reserved. 1 Truffle: A Self-Optimizing Runtime System Christian Wimmer, Thomas Würthinger Oracle Labs Write Your Own Language Current situation How it should be Prototype a new language Parser and language work

More information

Modern Stored Procedures Using GraalVM

Modern Stored Procedures Using GraalVM Modern Stored Procedures Using raalvm Oracle Labs Matthias Brantner Safe Harbor Statement The following is intended to outline our general product direction. t is intended

More information

1 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

1 Copyright 2012, Oracle and/or its affiliates. All rights reserved. 1 Copyright 2012, Oracle and/or its affiliates. All rights reserved. Truffle: A Self-Optimizing Runtime System Thomas Wuerthinger Oracle Labs JVM Language Summit, July 31, 2012 2 Copyright 2012, Oracle

More information

SPECIALISING DYNAMIC TECHNIQUES FOR IMPLEMENTING THE RUBY PROGRAMMING LANGUAGE

SPECIALISING DYNAMIC TECHNIQUES FOR IMPLEMENTING THE RUBY PROGRAMMING LANGUAGE SPECIALISING DYNAMIC TECHNIQUES FOR IMPLEMENTING THE RUBY PROGRAMMING LANGUAGE A thesis submitted to the University of Manchester for the degree of Doctor of Philosophy in the Faculty of Engineering and

More information

Dynamic Compilation with Truffle

Dynamic Compilation with Truffle Dynamic Compilation with Truffle Thomas Wuerthinger @thomaswue Oracle Labs Christian Humer @grashalm_ Oracle Labs DSLDI Summer School 2015 Copyright 2015 Oracle and/or its affiliates. All rights reserved.

More information

R as a in a Polyglot World

R as a in a Polyglot World R as a Ci@zen in a Polyglot World The promise of the Truffle framework Lukas Stadler, VM Research Group, Oracle Labs user! 2015 2 Safe Harbor Statement The following is intended to provide some insight

More information

<Insert Picture Here> Maxine: A JVM Written in Java

<Insert Picture Here> Maxine: A JVM Written in Java Maxine: A JVM Written in Java Michael Haupt Oracle Labs Potsdam, Germany The following is intended to outline our general product direction. It is intended for information purposes

More information

Substrate VM. Copyright 2017, Oracle and/or its affiliates. All rights reserved.

Substrate VM. Copyright 2017, Oracle and/or its affiliates. All rights reserved. Substrate VM 1 Safe Harbor Statement The following is intended to provide some insight into a line of research in Oracle Labs. It is intended for information purposes only, and may not be incorporated

More information

<Insert Picture Here>

<Insert Picture Here> 1 2010-0237 The Maxine Inspector: A Specialized Tool for VM Development, Santa Clara, CA Michael L. Van De Vanter Researcher, Oracle Sun Labs The Maxine Project at Oracle Sun Labs:

More information

FastR: Status and Outlook

FastR: Status and Outlook FastR: Status and Outlook Michael Haupt Tech Lead, FastR Project Virtual Machine Research Group, Oracle Labs June 2014 Copyright 2014 Oracle and/or its affiliates. All rights reserved. CMYK 0/100/100/20

More information

Self-Optimizing AST Interpreters

Self-Optimizing AST Interpreters Self-Optimizing AST Interpreters Thomas Würthinger Andreas Wöß Lukas Stadler Gilles Duboscq Doug Simon Christian Wimmer Oracle Labs Institute for System Software, Johannes Kepler University Linz, Austria

More information

CURRICULUM VITAE. DI Dr. Matthias Grimmer Michael-Hainisch-Straße Linz

CURRICULUM VITAE. DI Dr. Matthias Grimmer Michael-Hainisch-Straße Linz CURRICULUM VITAE Full Name Address Date of Birth Citizenship Phone Email Website GitHub DI Dr. Michael-Hainisch-Straße 18 4040 Linz March 2, 1989 Austria (+43) 664 784 21 52 contact@matthiasgrimmer.com

More information

<Insert Picture Here> Graal: A quest for the JVM to leverage its own J Doug Simon - Oracle Labs

<Insert Picture Here> Graal: A quest for the JVM to leverage its own J Doug Simon - Oracle Labs Graal: A quest for the JVM to leverage its own J Doug Simon - Oracle Labs JVM Language Summit, 30th July 2012 The following is intended to outline our general product direction. It

More information

JDK 9/10/11 and Garbage Collection

JDK 9/10/11 and Garbage Collection JDK 9/10/11 and Garbage Collection Thomas Schatzl Senior Member of Technical Staf Oracle JVM Team May, 2018 thomas.schatzl@oracle.com Copyright 2017, Oracle and/or its afliates. All rights reserved. 1

More information

Contents in Detail. Who This Book Is For... xx Using Ruby to Test Itself... xx Which Implementation of Ruby?... xxi Overview...

Contents in Detail. Who This Book Is For... xx Using Ruby to Test Itself... xx Which Implementation of Ruby?... xxi Overview... Contents in Detail Foreword by Aaron Patterson xv Acknowledgments xvii Introduction Who This Book Is For................................................ xx Using Ruby to Test Itself.... xx Which Implementation

More information

Tracing vs. Partial Evaluation

Tracing vs. Partial Evaluation Tracing vs. Partial Evaluation Comparing Meta-Compilation Approaches for Self-Optimizing nterpreters Abstract Tracing and partial evaluation have been proposed as metacompilation techniques for interpreters.

More information

Accelerating Ruby with LLVM

Accelerating Ruby with LLVM Accelerating Ruby with LLVM Evan Phoenix Oct 2, 2009 RUBY RUBY Strongly, dynamically typed RUBY Unified Model RUBY Everything is an object RUBY 3.class # => Fixnum RUBY Every code context is equal RUBY

More information

Copyright 2013, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12!

Copyright 2013, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12! Insert Information Protection Policy Classification from Slide 12!1 VMs I Have Known and/or Loved! A subjective history Mario Wolczko Architect Virtual Machine Research Group Oracle Labs! http://labs.oracle.com

More information

code://rubinius/technical

code://rubinius/technical code://rubinius/technical /GC, /cpu, /organization, /compiler weeee!! Rubinius New, custom VM for running ruby code Small VM written in not ruby Kernel and everything else in ruby http://rubini.us git://rubini.us/code

More information

Oracle R Technologies

Oracle R Technologies Oracle R Technologies R for the Enterprise Mark Hornick, Director, Oracle Advanced Analytics @MarkHornick mark.hornick@oracle.com Safe Harbor Statement The following is intended to outline our general

More information

Are We There Yet? Simple Language-Implementation Techniques for the 21st Century

Are We There Yet? Simple Language-Implementation Techniques for the 21st Century Are We There Yet? Simple Language-Implementation Techniques for the 21st Century Stefan Marr, Tobias Pape, Wolfgang De Meuter To cite this version: Stefan Marr, Tobias Pape, Wolfgang De Meuter. Are We

More information

What*Language* Would*You*Like*to*Run?*

What*Language* Would*You*Like*to*Run?* What*Language* Would*You*Like*to*Run?* Michael*Haupt* Oracle*Labs* March*2015* Safe*Harbor*Statement* The*following*is*intended*to*provide*some*insight*into*a*line*of*research*in*Oracle*Labs.*It* is*intended*for*informaoon*purposes*only,*and*may*not*be*incorporated*into*any*

More information

Safe Harbor Statement

Safe Harbor Statement Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment

More information

Practical Partial Evaluation for High-Performance Dynamic Language Runtimes

Practical Partial Evaluation for High-Performance Dynamic Language Runtimes Practical Partial Evaluation for High-Performance Dynamic Language Runtimes Thomas Würthinger Christian Wimmer Christian Humer Andreas Wöß Lukas Stadler Chris Seaton Gilles Duboscq Doug Simon Matthias

More information

One VM to Rule Them All

One VM to Rule Them All One VM to Rule Them All Christian Wimmer VM Research Group, Oracle Labs Safe Harbor Statement The following is intended to provide some insight into a line of research in Oracle Labs. It is intended for

More information

JAVA PERFORMANCE. PR SW2 S18 Dr. Prähofer DI Leopoldseder

JAVA PERFORMANCE. PR SW2 S18 Dr. Prähofer DI Leopoldseder JAVA PERFORMANCE PR SW2 S18 Dr. Prähofer DI Leopoldseder OUTLINE 1. What is performance? 1. Benchmarking 2. What is Java performance? 1. Interpreter vs JIT 3. Tools to measure performance 4. Memory Performance

More information

Ahead of Time (AOT) Compilation

Ahead of Time (AOT) Compilation Ahead of Time (AOT) Compilation Vaibhav Choudhary (@vaibhav_c) Java Platforms Team https://blogs.oracle.com/vaibhav Copyright 2018, Oracle and/or its affiliates. All rights reserved. Safe Harbor Statement

More information

Course introduction. Advanced Compiler Construction Michel Schinz

Course introduction. Advanced Compiler Construction Michel Schinz Course introduction Advanced Compiler Construction Michel Schinz 2016 02 25 General information Course goals The goal of this course is to teach you: how to compile high-level functional and objectoriented

More information

Efficient Layered Method Execution in ContextAmber

Efficient Layered Method Execution in ContextAmber Efficient Layered Method Execution in ContextAmber Matthias Springer Hasso Plattner Institute University of Potsdam matthias.springer@hpi.de Jens Lincke Hasso Plattner Institute University of Potsdam jens.lincke@hpi.de

More information

The Z Garbage Collector Scalable Low-Latency GC in JDK 11

The Z Garbage Collector Scalable Low-Latency GC in JDK 11 The Z Garbage Collector Scalable Low-Latency GC in JDK 11 Per Lidén (@perliden) Consulting Member of Technical Staff Java Platform Group, Oracle October 24, 2018 Safe Harbor Statement The following is

More information

Mission Possible - Near zero overhead profiling. Klara Ward Principal Software Developer Java Mission Control team, Oracle February 6, 2018

Mission Possible - Near zero overhead profiling. Klara Ward Principal Software Developer Java Mission Control team, Oracle February 6, 2018 Mission Possible - Near zero overhead profiling Klara Ward Principal Software Developer Java Mission Control team, Oracle February 6, 2018 Hummingbird image by Yutaka Seki is licensed under CC BY 2.0 Copyright

More information

Zero-Overhead Metaprogramming

Zero-Overhead Metaprogramming Zero-Overhead Metaprogramming Reflection and Metaobject Protocols Fast and without Compromises * PLDI * Artifact Consistent * Complete * Well Documented * Easy to Reuse * Evaluated * AEC * Stefan Marr

More information

Agenda. CSE P 501 Compilers. Java Implementation Overview. JVM Architecture. JVM Runtime Data Areas (1) JVM Data Types. CSE P 501 Su04 T-1

Agenda. CSE P 501 Compilers. Java Implementation Overview. JVM Architecture. JVM Runtime Data Areas (1) JVM Data Types. CSE P 501 Su04 T-1 Agenda CSE P 501 Compilers Java Implementation JVMs, JITs &c Hal Perkins Summer 2004 Java virtual machine architecture.class files Class loading Execution engines Interpreters & JITs various strategies

More information

Understanding How Graal Works

Understanding How Graal Works Understanding How Graal Works a Java JIT Compiler Written in Java Chris Seaton Research Manager Oracle Labs chris.seaton@oracle.com @ChrisGSeaton Copyright 2017, Oracle and/or its affiliates. All rights

More information

Java: framework overview and in-the-small features

Java: framework overview and in-the-small features Chair of Software Engineering Carlo A. Furia, Marco Piccioni, Bertrand Meyer Java: framework overview and in-the-small features Chair of Software Engineering Carlo A. Furia, Marco Piccioni, Bertrand Meyer

More information

Efficient and Thread-Safe Objects for Dynamically-Typed Languages

Efficient and Thread-Safe Objects for Dynamically-Typed Languages *Evaluated*OOPSLA*Artifact*AEC Efficient and Thread-Safe Objects for Dynamically-Typed Languages toreuse* Consistent*Complete*WellDocumented*Easy Benoit Daloze Johannes Kepler University Linz, Austria

More information

Optimizing Communicating Event-Loop Languages with Truffle

Optimizing Communicating Event-Loop Languages with Truffle Optimizing Communicating Event-Loop Languages with Truffle [Work In Progress Paper] Stefan Marr Johannes Kepler University Linz, Austria stefan.marr@jku.at ABSTRACT Communicating Event-Loop Languages similar

More information

Alan Bateman Java Platform Group, Oracle November Copyright 2018, Oracle and/or its affiliates. All rights reserved.!1

Alan Bateman Java Platform Group, Oracle November Copyright 2018, Oracle and/or its affiliates. All rights reserved.!1 Alan Bateman Java Platform Group, Oracle November 2018 Copyright 2018, Oracle and/or its affiliates. All rights reserved.!1 Project Loom Continuations Fibers Tail-calls Copyright 2018, Oracle and/or its

More information

MRI Internals. Koichi Sasada.

MRI Internals. Koichi Sasada. MRI Internals Koichi Sasada ko1@heroku.com MRI Internals towards Ruby 3 Koichi Sasada ko1@heroku.com Today s talk Koichi is working on improving Ruby internals Introduce my ideas toward Ruby 3 Koichi Sasada

More information

Java On Steroids: Sun s High-Performance Java Implementation. History

Java On Steroids: Sun s High-Performance Java Implementation. History Java On Steroids: Sun s High-Performance Java Implementation Urs Hölzle Lars Bak Steffen Grarup Robert Griesemer Srdjan Mitrovic Sun Microsystems History First Java implementations: interpreters compact

More information

CS 360 Programming Languages Interpreters

CS 360 Programming Languages Interpreters CS 360 Programming Languages Interpreters Implementing PLs Most of the course is learning fundamental concepts for using and understanding PLs. Syntax vs. semantics vs. idioms. Powerful constructs like

More information

Pause-Less GC for Improving Java Responsiveness. Charlie Gracie IBM Senior Software charliegracie

Pause-Less GC for Improving Java Responsiveness. Charlie Gracie IBM Senior Software charliegracie Pause-Less GC for Improving Java Responsiveness Charlie Gracie IBM Senior Software Developer charlie_gracie@ca.ibm.com @crgracie charliegracie 1 Important Disclaimers THE INFORMATION CONTAINED IN THIS

More information

An Oz implementation using Truffle and Graal

An Oz implementation using Truffle and Graal An Oz implementation using Truffle and Graal Dissertation presented by Maxime ISTASSE for obtaining the Master s degree in Computer Science and Engineering Supervisor(s) Peter VAN ROY, Benoit DALOZE, Guillaume

More information

The Z Garbage Collector Low Latency GC for OpenJDK

The Z Garbage Collector Low Latency GC for OpenJDK The Z Garbage Collector Low Latency GC for OpenJDK Per Lidén & Stefan Karlsson HotSpot Garbage Collection Team Jfokus VM Tech Summit 2018 Safe Harbor Statement The following is intended to outline our

More information

CSE P 501 Compilers. Java Implementation JVMs, JITs &c Hal Perkins Winter /11/ Hal Perkins & UW CSE V-1

CSE P 501 Compilers. Java Implementation JVMs, JITs &c Hal Perkins Winter /11/ Hal Perkins & UW CSE V-1 CSE P 501 Compilers Java Implementation JVMs, JITs &c Hal Perkins Winter 2008 3/11/2008 2002-08 Hal Perkins & UW CSE V-1 Agenda Java virtual machine architecture.class files Class loading Execution engines

More information

Just-In-Time GPU Compilation for Interpreted Languages with Partial Evaluation

Just-In-Time GPU Compilation for Interpreted Languages with Partial Evaluation Just-In-Time GPU Compilation for Interpreted Languages with Partial Evaluation Juan Fumero Michel Steuwer Lukas Stadler Christophe Dubach The University of Edinburgh, Oracle Labs, AT juan.fumero@ed.ac.uk

More information

The Z Garbage Collector An Introduction

The Z Garbage Collector An Introduction The Z Garbage Collector An Introduction Per Lidén & Stefan Karlsson HotSpot Garbage Collection Team FOSDEM 2018 Safe Harbor Statement The following is intended to outline our general product direction.

More information

Trace Compilation. Christian Wimmer September 2009

Trace Compilation. Christian Wimmer  September 2009 Trace Compilation Christian Wimmer cwimmer@uci.edu www.christianwimmer.at September 2009 Department of Computer Science University of California, Irvine Background Institute for System Software Johannes

More information

Introduction to Java

Introduction to Java Introduction to Java Module 1: Getting started, Java Basics 22/01/2010 Prepared by Chris Panayiotou for EPL 233 1 Lab Objectives o Objective: Learn how to write, compile and execute HelloWorld.java Learn

More information

Tracing vs. Partial Evaluation

Tracing vs. Partial Evaluation Tracing vs. Partial Evaluation Stefan Marr, Stéphane Ducasse To cite this version: Stefan Marr, Stéphane Ducasse. Tracing vs. Partial Evaluation: Comparing Meta-Compilation Approaches for Self-Optimizing

More information

A Trace-based Java JIT Compiler Retrofitted from a Method-based Compiler

A Trace-based Java JIT Compiler Retrofitted from a Method-based Compiler A Trace-based Java JIT Compiler Retrofitted from a Method-based Compiler Hiroshi Inoue, Hiroshige Hayashizaki, Peng Wu and Toshio Nakatani IBM Research Tokyo IBM Research T.J. Watson Research Center April

More information

Project Loom Ron Pressler, Alan Bateman June 2018

Project Loom Ron Pressler, Alan Bateman June 2018 Project Loom Ron Pressler, Alan Bateman June 2018 Copyright 2018, Oracle and/or its affiliates. All rights reserved.!1 Safe Harbor Statement The following is intended to outline our general product direction.

More information

JamaicaVM Java for Embedded Realtime Systems

JamaicaVM Java for Embedded Realtime Systems JamaicaVM Java for Embedded Realtime Systems... bringing modern software development methods to safety critical applications Fridtjof Siebert, 25. Oktober 2001 1 Deeply embedded applications Examples:

More information

Copyright 2014, Oracle and/or its affiliates. All rights reserved.

Copyright 2014, Oracle and/or its affiliates. All rights reserved. 1 One VM to Rule Them All Christian Wimmer VM Research Group, Oracle Labs The following is intended to provide some insight into a line of research in Oracle Labs. It is intended for information purposes

More information

Compact and Efficient Strings for Java

Compact and Efficient Strings for Java Compact and Efficient Strings for Java Christian Häubl, Christian Wimmer, Hanspeter Mössenböck Institute for System Software, Christian Doppler Laboratory for Automated Software Engineering, Johannes Kepler

More information

This class is about understanding how programs work

This class is about understanding how programs work CMSC 245 Wrap-up This class is about understanding how programs work To do this, we re going to have to learn how a computer works Learned a ton in the class Lexical vs. Dynamic Scoping Regexp Parsing

More information

Java Performance: The Definitive Guide

Java Performance: The Definitive Guide Java Performance: The Definitive Guide Scott Oaks Beijing Cambridge Farnham Kbln Sebastopol Tokyo O'REILLY Table of Contents Preface ix 1. Introduction 1 A Brief Outline 2 Platforms and Conventions 2 JVM

More information

Modules, Structs, Hashes, and Operational Semantics

Modules, Structs, Hashes, and Operational Semantics CS 152: Programming Language Paradigms Modules, Structs, Hashes, and Operational Semantics Prof. Tom Austin San José State University Lab Review (in-class) Modules Review Modules from HW 1 (in-class) How

More information

JVM Continuations. Lukas Stadler. Johannes Kepler University Linz, Austria

JVM Continuations. Lukas Stadler. Johannes Kepler University Linz, Austria JVM Continuations Lukas Stadler Johannes Kepler University Linz, Austria Agenda Continuations Uses for continuations Common implementation techniques Our lazy approach Implementation Summary Continuations

More information

CS152 Programming Language Paradigms Prof. Tom Austin, Fall Syntax & Semantics, and Language Design Criteria

CS152 Programming Language Paradigms Prof. Tom Austin, Fall Syntax & Semantics, and Language Design Criteria CS152 Programming Language Paradigms Prof. Tom Austin, Fall 2014 Syntax & Semantics, and Language Design Criteria Lab 1 solution (in class) Formally defining a language When we define a language, we need

More information

IBM Cognos ReportNet and the Java Heap

IBM Cognos ReportNet and the Java Heap Proven Practice IBM Cognos ReportNet and the Java Heap Product(s): IBM Cognos ReportNet, IBM Cognos 8 Area of Interest: Performance 2 Copyright Copyright 2008 Cognos ULC (formerly Cognos Incorporated).

More information

PyPy - How to not write Virtual Machines for Dynamic Languages

PyPy - How to not write Virtual Machines for Dynamic Languages PyPy - How to not write Virtual Machines for Dynamic Languages Institut für Informatik Heinrich-Heine-Universität Düsseldorf ESUG 2007 Scope This talk is about: implementing dynamic languages (with a focus

More information

Sista: Improving Cog s JIT performance. Clément Béra

Sista: Improving Cog s JIT performance. Clément Béra Sista: Improving Cog s JIT performance Clément Béra Main people involved in Sista Eliot Miranda Over 30 years experience in Smalltalk VM Clément Béra 2 years engineer in the Pharo team Phd student starting

More information

Pegarus & Poison. Rubinius VM as a Multilanguage Platform

Pegarus & Poison. Rubinius VM as a Multilanguage Platform Pegarus & Poison Rubinius VM as a Multilanguage Platform Thursday, July 29, 2010 Brian Ford brixen on {twitter IRC gmail} Thursday, July 29, 2010 discussion rant tutorial Q&A interaction Thursday, July

More information

What a Year! Java 10 and 10 Big Java Milestones

What a Year! Java 10 and 10 Big Java Milestones What a Year! Java 10 and 10 Big Java Milestones Java has made tremendous strides in the past 12 months, with exciting new features and capabilities for developers of all kinds. Table of Contents INTRODUCTION

More information

September 15th, Finagle + Java. A love story (

September 15th, Finagle + Java. A love story ( September 15th, 2016 Finagle + Java A love story ( ) @mnnakamura hi, I m Moses Nakamura Twitter lives on the JVM When Twitter realized we couldn t stay on a Rails monolith and continue to scale at the

More information

Running class Timing on Java HotSpot VM, 1

Running class Timing on Java HotSpot VM, 1 Compiler construction 2009 Lecture 3. A first look at optimization: Peephole optimization. A simple example A Java class public class A { public static int f (int x) { int r = 3; int s = r + 5; return

More information

COP4020 Programming Languages. Compilers and Interpreters Robert van Engelen & Chris Lacher

COP4020 Programming Languages. Compilers and Interpreters Robert van Engelen & Chris Lacher COP4020 ming Languages Compilers and Interpreters Robert van Engelen & Chris Lacher Overview Common compiler and interpreter configurations Virtual machines Integrated development environments Compiler

More information

Bytecode Manipulation Techniques for Dynamic Applications for the Java Virtual Machine

Bytecode Manipulation Techniques for Dynamic Applications for the Java Virtual Machine Bytecode Manipulation Techniques for Dynamic Applications for the Java Virtual Machine Eugene Kuleshov, Terracotta Tim Eck, Terracotta Tom Ware, Oracle Corporation Charles Nutter, Sun Microsystems, Inc.

More information

A Fast Abstract Syntax Tree Interpreter for R

A Fast Abstract Syntax Tree Interpreter for R A Fast Abstract Syntax Tree Interpreter for R Java cup Petr Maj Jan Vitek Tomas Kalibera Floréal Morandat Thesis Runtime information can be leveraged to create simple, fast, easy to maintain interpreters

More information

Just-In-Time Compilation

Just-In-Time Compilation Just-In-Time Compilation Thiemo Bucciarelli Institute for Software Engineering and Programming Languages 18. Januar 2016 T. Bucciarelli 18. Januar 2016 1/25 Agenda Definitions Just-In-Time Compilation

More information

Managed runtimes & garbage collection. CSE 6341 Some slides by Kathryn McKinley

Managed runtimes & garbage collection. CSE 6341 Some slides by Kathryn McKinley Managed runtimes & garbage collection CSE 6341 Some slides by Kathryn McKinley 1 Managed runtimes Advantages? Disadvantages? 2 Managed runtimes Advantages? Reliability Security Portability Performance?

More information

Servlet Performance and Apache JServ

Servlet Performance and Apache JServ Servlet Performance and Apache JServ ApacheCon 1998 By Stefano Mazzocchi and Pierpaolo Fumagalli Index 1 Performance Definition... 2 1.1 Absolute performance...2 1.2 Perceived performance...2 2 Dynamic

More information

Intermediate Language Design of High- level Language VMs

Intermediate Language Design of High- level Language VMs Intermediate Language Design of High- level Language VMs Towards Comprehensive Concurrency Support Stefan Marr SoOware Languages Lab Vrije Universiteit Brussel Michael Haupt Hasso PlaKner InsLtute University

More information

JRuby: Bringing Ruby to the JVM

JRuby: Bringing Ruby to the JVM JRuby: Bringing Ruby to the JVM Thomas E. Enebo Aandtech Inc. Charles Oliver Nutter Ventera Corp http://www.jruby.org TS-3059 2006 JavaOne SM Conference Session TS-3059 JRuby Presentation Goal Learn what

More information

Managed runtimes & garbage collection

Managed runtimes & garbage collection Managed runtimes Advantages? Managed runtimes & garbage collection CSE 631 Some slides by Kathryn McKinley Disadvantages? 1 2 Managed runtimes Portability (& performance) Advantages? Reliability Security

More information

Compiling Techniques

Compiling Techniques Lecture 2: The view from 35000 feet 19 September 2017 Table of contents 1 2 Passes Representations 3 Instruction Selection Register Allocation Instruction Scheduling 4 of a compiler Source Compiler Machine

More information

Eliminating Global Interpreter Locks in Ruby through Hardware Transactional Memory

Eliminating Global Interpreter Locks in Ruby through Hardware Transactional Memory Eliminating Global Interpreter Locks in Ruby through Hardware Transactional Memory Rei Odaira, Jose G. Castanos and Hisanobu Tomari IBM Research and University of Tokyo April 8, 2014 Rei Odaira, Jose G.

More information

2011 Oracle Corporation and Affiliates. Do not re-distribute!

2011 Oracle Corporation and Affiliates. Do not re-distribute! How to Write Low Latency Java Applications Charlie Hunt Java HotSpot VM Performance Lead Engineer Who is this guy? Charlie Hunt Lead JVM Performance Engineer at Oracle 12+ years of

More information

C#: framework overview and in-the-small features

C#: framework overview and in-the-small features Chair of Software Engineering Carlo A. Furia, Marco Piccioni, Bertrand Meyer C#: framework overview and in-the-small features Chair of Software Engineering Carlo A. Furia, Marco Piccioni, Bertrand Meyer

More information

RUBY IS A PURE OBJECT-ORIENTED interpreted language.

RUBY IS A PURE OBJECT-ORIENTED interpreted language. Proceedings of the Federated Conference on Computer Science and Information Systems pp. 947 952 DOI: 10.15439/2015F99 ACSIS, Vol. 5 Ruby Benchmark Tool using Docker Richard Ludvigh, Tomáš Rebok Faculty

More information

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

Copyright 2012, Oracle and/or its affiliates. All rights reserved. 1 Jump-Starting Lambda Stuart Marks @stuartmarks Mike Duigou @mjduigou Oracle JDK Core Libraries Team 2 What is Lambda? Essentially an anonymous function allows one to treat code as data provides parameterization

More information

Run-time Program Management. Hwansoo Han

Run-time Program Management. Hwansoo Han Run-time Program Management Hwansoo Han Run-time System Run-time system refers to Set of libraries needed for correct operation of language implementation Some parts obtain all the information from subroutine

More information

Unrestricted and Safe Dynamic Code Evolution for Java

Unrestricted and Safe Dynamic Code Evolution for Java Unrestricted and Safe Dynamic Code Evolution for Java Thomas Würthinger a, Christian Wimmer b, Lukas Stadler a a Institute for System Software, Christian Doppler Laboratory for Automated Software Engineering,

More information

CSE 341, Spring 2011, Final Examination 9 June Please do not turn the page until everyone is ready.

CSE 341, Spring 2011, Final Examination 9 June Please do not turn the page until everyone is ready. CSE 341, Spring 2011, Final Examination 9 June 2011 Please do not turn the page until everyone is ready. Rules: The exam is closed-book, closed-note, except for one side of one 8.5x11in piece of paper.

More information

Beyond the Coffee Cup:

Beyond the Coffee Cup: Beyond the Coffee Cup: Leveraging Java Runtime Technologies for Polyglot Daryl Maier Senior Software Developer at IBM Canada IBM Runtimes maier@ca.ibm.com About me IBM Canada Lab in Toronto (-ish) Member

More information

Compiler construction 2009

Compiler construction 2009 Compiler construction 2009 Lecture 3 JVM and optimization. A first look at optimization: Peephole optimization. A simple example A Java class public class A { public static int f (int x) { int r = 3; int

More information

Flow-sensitive rewritings and Inliner improvements for the Graal JIT compiler

Flow-sensitive rewritings and Inliner improvements for the Graal JIT compiler 1 / 25 Flow-sensitive rewritings and for the Graal JIT compiler Miguel Garcia http://lampwww.epfl.ch/~magarcia/ 2014-07-07 2 / 25 Outline Flow-sensitive rewritings during HighTier Example Rewritings in

More information

EDAN65: Compilers, Lecture 13 Run;me systems for object- oriented languages. Görel Hedin Revised:

EDAN65: Compilers, Lecture 13 Run;me systems for object- oriented languages. Görel Hedin Revised: EDAN65: Compilers, Lecture 13 Run;me systems for object- oriented languages Görel Hedin Revised: 2014-10- 13 This lecture Regular expressions Context- free grammar ATribute grammar Lexical analyzer (scanner)

More information

Java Performance Tuning and Optimization Student Guide

Java Performance Tuning and Optimization Student Guide Java Performance Tuning and Optimization Student Guide D69518GC10 Edition 1.0 June 2011 D73450 Disclaimer This document contains proprietary information and is protected by copyright and other intellectual

More information

TRASH DAY: COORDINATING GARBAGE COLLECTION IN DISTRIBUTED SYSTEMS

TRASH DAY: COORDINATING GARBAGE COLLECTION IN DISTRIBUTED SYSTEMS TRASH DAY: COORDINATING GARBAGE COLLECTION IN DISTRIBUTED SYSTEMS Martin Maas* Tim Harris KrsteAsanovic* John Kubiatowicz* *University of California, Berkeley Oracle Labs, Cambridge Why you should care

More information

Compiler Design Spring 2017

Compiler Design Spring 2017 Compiler Design Spring 2017 6.0 Runtime system and object layout Dr. Zoltán Majó Compiler Group Java HotSpot Virtual Machine Oracle Corporation 1 Runtime system Some open issues from last time Handling

More information