Java in High-Performance Computing

Size: px
Start display at page:

Download "Java in High-Performance Computing"

Transcription

1 Java in High-Performance Computing Dawid Weiss Carrot Search Institute of Computing Science, Poznan University of Technology GeeCon Poznań, 05/2010

2

3

4 Learn from the mistakes of others. You can t live long enough to make them all yourself. Eleanor Roosevelt

5

6 Talk outline What is High performance? What is Java? Measuring performance (benchmarking). HPPC library.

7 Talk outline What is High performance? What is Java? Measuring performance (benchmarking). HPPC library. Crosscutting: (un?)common pitfalls and performance killers. Some HotSpot internals.

8 Divide-and-conquer style algorithm for (Example e : examples) { e.hasquiz()? e.showquiz() : e.showcode(); e.explain(); e.deriveconclusions(); }

9

10 PART I High Performance Computing

11 High-performance computing (HPC) uses supercomputers and computer clusters to solve advanced computation problems. Wikipedia

12 Is Java faster than C/C++? The short answer is: it depends. Cliff Click

13 It s usually hard to make a fast program run faster.

14 It s usually hard to make a fast program run faster. It s easy to make a slow program run even slower.

15 It s usually hard to make a fast program run faster. It s easy to make a slow program run even slower. It s easy to make fast hardware run slow.

16 For now, HPC limited allowed computation time, constrained resources (hardware, memory).

17 For now, HPC limited allowed computation time, constrained resources (hardware, memory). Good HPC software no (obvious) flaws.

18 PART II What is Java? (Recall: Is Java faster than C/C++?)

19 Example 1 public void testsum1() { int sum = 0; for (int i = 0; i < COUNT; i++) sum += sum1(i, i); result = sum; } public void testsum2() { int sum = 0; for (int i = 0; i < COUNT; i++) sum += sum2(i, i); result = sum; }

20 Example 1 public void testsum1() { int sum = 0; for (int i = 0; i < COUNT; i++) sum += sum1(i, i); result = sum; } public void testsum2() { int sum = 0; for (int i = 0; i < COUNT; i++) sum += sum2(i, i); result = sum; } where the body of sum1 and sum2 sums arguments and returns the result and COUNT is significantly large...

21 sun VM sum1 sum2

22 VM sum1 sum2 sun

23 VM sum1 sum2 sun sun

24 VM sum1 sum2 sun sun sun

25 VM sum1 sum2 sun sun sun ibm-1.6.2

26 VM sum1 sum2 sun sun sun ibm jrockit

27 VM sum1 sum2 sun sun sun ibm jrockit harmony-r917296

28 VM sum1 sum2 sun sun sun ibm jrockit harmony-r (averages in sec., 10 measured rounds, 5 warmup, 64-bit Ubuntu, dual-core AMD Athlon 5200).

29 VM sum1 sum2 sum3 sum4 sun sun sun ibm jrockit harmony-r (averages in sec., 10 measured rounds, 5 warmup, 64-bit Ubuntu, dual-core AMD Athlon 5200).

30 int sum1(int a, int b) { return a + b; } Integer sum2(integer a, Integer b) { return a + b; } Integer sum2(integer a, Integer b) { return Integer.valueOf( a.intvalue() + b.intvalue()); }

31 int sum3(int... args) { int sum = 0; for (int i = 0; i < args.length; i++) sum += args[i]; return sum; } Integer sum4(integer... args) { int sum = 0; for (int i = 0; i < args.length; i++) { sum += args[i]; } return sum; } Integer sum4(integer [] args) { //... }

32 Conclusions Syntactic sugar may be costly. Primitive types are fast. Large differences between different VMs.

33

34 Example 2 Write once, run anywhere!

35

36

37

38 But it s the same VM!

39 It works on my machine!

40 private static boolean ready; public static void startthread() { new Thread() { public void run() { try { sleep(2000); } catch (Exception e) { /* ignore */ } System.out.println("Marking loop exit."); ready = true; } }.start(); } public static void main(string[] args) { startthread(); System.out.println("Entering the loop..."); while (!ready) { // Do nothing. } System.out.println("Done, I left the loop!"); }

41 while (!ready) { // Do nothing. }? boolean r = ready; while (!r) { // Do nothing. }

42 while (!ready) { // Do nothing. }? boolean r = ready; while (!r) { // Do nothing. } In most cases true, from a JMM perspective.

43 JVM Internals...

44

45

46

47 C1: fast not (much) optimization C2: slow(er) than C1 a lot of JMM-allowed optimizations

48 There are hundreds of JVM tuning/diagnostic switches.

49 My personal favorite:

50 Conclusions Bytecode is far from what is executed. A lot going on under the (VM) hood. Bad code may work, but will eventually crash. HotSpot-level optimizations are good.

51 Conclusions Bytecode is far from what is executed. A lot going on under the (VM) hood. Bad code may work, but will eventually crash. HotSpot-level optimizations are good. If there is a bug in the HotSpot compiler...

52

53

54

55 Any other diversifying factors?

56

57 J2ME more VM vendors, hardware diversity, software and hardware quirks.

58

59 Non-JVM target platforms Dalvik GWT IKVM

60

61 Conclusions There is no single Java performance model. Performance depends on the VM, environment, class library, hardware. Apply benchmark-and-correct cycle.

62 Benchmarking

63 Example 3 public void testsum1() { int sum = 0; for (int i = 0; i < COUNT; i++) sum += sum1(i, i); result = sum; } public void testsum1_2() { int sum = 0; for (int i = 0; i < COUNT; i++) sum += sum1(i, i); }

64 sun VM sum1 sum1_2

65 VM sum1 sum1_2 sun

66 VM sum1 sum1_2 sun

67 VM sum1 sum1_2 sun sun sun ibm jrockit harmony-r (averages in sec., 10 measured rounds, 5 warmup, 64-bit Ubuntu, dual-core AMD Athlon 5200).

68

69 java -server -XX:+PrintOptoAssembly -XX:+PrintCompilation...

70 java -server -XX:+PrintOptoAssembly -XX:+PrintCompilation... - method holder: com/dawidweiss/geecon2010/example03 - access: 0xc public - name: testsum1_ pushq rbp subq rsp, #16 # Create frame nop # nop for patch_verified_entry 016 addq rsp, 16 # Destroy frame popq rbp testl rax, [rip + #offset_to_poll_page] # Safepoint: poll for GC 021 ret

71 Conclusions Benchmarks must be executed to provide feedback. HotSpot is smart and effective at removing dead code.

72 Example public void testadd1() { int sum = 0; for (int i = 0; i < COUNT; i++) { sum += add1(i); } guard = sum; } public int add1(int i) { return i + 1; } Note add1 is virtual.

73 switch testadd1 -XX:+Inlining -XX:+PrintInlining XX:-Inlining? (averages in sec., 10 measured rounds, 5 warmup, 64-bit Ubuntu, dual-core AMD Athlon 5200, JRE 1.7b80-debug).

74 switch testadd1 -XX:+Inlining -XX:+PrintInlining XX:-Inlining 0.45 (averages in sec., 10 measured rounds, 5 warmup, 64-bit Ubuntu, dual-core AMD Athlon 5200, JRE 1.7b80-debug).

75 Most Java calls are monomorphic.

76 HotSpot adjusts to megamorphic calls automatically.

77 Example 5 abstract class Superclass { abstract int call(); } class Sub1 extends Superclass { int call() { return 1; } } class Sub2 extends Superclass { int call() { return 2; } } class Sub3 extends Superclass { int call() { return 3; } } Superclass[] mixed = initwithrandominstances(10000); Superclass[] solid = public void testmonomorphic() { int sum = 0; int m = solid.length; for (int i = 0; i < COUNT; i++) sum += solid[i % m].call(); guard = sum; public void testmegamorphic() { int sum = 0; int m = mixed.length; for (int i = 0; i < COUNT; i++) sum += mixed[i % m].call(); guard = sum; }

78 VM monomorphic megamorphic sun sun sun ibm jrockit harmony-r (averages in sec., 10 measured rounds, 5 warmup, 64-bit Ubuntu, dual-core AMD Athlon 5200).

79 Example public void testbitcount1() { int sum = 0; for (int i = 0; i < COUNT; i++) sum += Integer.bitCount(i); guard = sum; public void testbitcount2() { int sum = 0; for (int i = 0; i < COUNT; i++) sum += bitcount(i); guard = sum; } /* Copied from * Integer#bitCount} */ static int bitcount(int i) { // HD, Figure 5-2 i = i - ((i >>> 1) & 0x ); i = (i & 0x ) + ((i >>> 2) & 0x ); i = (i + (i >>> 4)) & 0x0f0f0f0f; i = i + (i >>> 8); i = i + (i >>> 16); return i & 0x3f; }

80 VM testbitcount1 testbitcount2 sun sun b (averages in sec., 10 measured rounds, 5 warmup, 64-bit Ubuntu, dual-core AMD Athlon 5200).

81 VM testbitcount1 testbitcount2 sun sun b (averages in sec., 10 measured rounds, 5 warmup, 64-bit Ubuntu, dual-core AMD Athlon 5200). VM testbitcount1 testbitcount2 sun sun b (averages in sec., 10 measured rounds, 5 warmup, 64-bit Windows 7, Intel I7 860).

82 ... -XX:+PrintInlining...

83 ... -XX:+PrintInlining Inlining intrinsic _bitcount_i at bci:9 in..example06::testbitcount1 Inlining intrinsic _bitcount_i at bci:9 in..example06::testbitcount1 Inlining intrinsic _bitcount_i at bci:9 in..example06::testbitcount1 Example06.testBitCount1: [measured 10 out of 15 rounds] round: 0.07 [ ], round.gc: 0.00 [+- 9 com.dawidweiss.geecon2010.example06::bitcount inline 9 com.dawidweiss.geecon2010.example06::bitcount inline 9 com.dawidweiss.geecon2010.example06::bitcount inline (hot) Example06.testBitCount2: [measured 10 out of 15 rounds] round: 0.32 [ ], round.gc: 0.00 [ ]...

84 ... -XX:+PrintOptoAssembly...

85 ... -XX:+PrintOptoAssembly... {method} - klass: {other class} - method holder: com/dawidweiss/geecon2010/example06 - name: testbitcount1... 0c2 B13: # B12 B14 <- B8 B12 Loop: B13-B12 inner stride:... 0c2 movl R10, RDX # spill... 0e1 movl [rsp + #40], R11 # spill 0e6 popcnt R8, R8... 0f5 addl R9, #7 # int 0f9 popcnt R11, R11 0fe popcnt RCX, R9

86

87

88 Conclusions Benchmarks must be statistically sound. averages, variance, min, max, warm-up phase Account for HotSpot optimisations. Account for hardware differences. test-on-target Use domain data and real scenarios. Inspect suspicious output with debug JVM. See more: Cliff Click,

89 HPPC High Performance Primitive Collections

90 Motivation Primitive types: fast and memory-friendly. Optional assertions. Single-threaded. No fail-fast. Fast, fast, fast iterators, with no GC overhead. Open internals (explicit implementation). Programmers know what they re doing.

91 Why not JCF? public interface List<E> extends Collection<E> { boolean contains(object o); // [-] contract-enforced methods Iterator<E> iterator(); // [-] iterators over primitive types? Object[] toarray(); // [-] troublesome covariants...

92 Friendly Competition fastutil PCJ GNU Trove Apache Mahout (ported COLT) Apache Primitive Collections All of these have pros and cons and deal with JCF compatibility somehow.

93 Iterators in fastutil or PCJ interface IntIterator extends Iterator<Integer> { // Primitive-specific method int nextint(); }

94 Iterators in HPPC public final class IntCursor { public int index; public int value; } public class IntArrayList extends Iterable<IntCursor> { Iterator<IntCursor> iterator() {... } }

95 Iterating over list elements in HPPC for (IntCursor c : list) { System.out.println(c.index + ": " + c.value); }

96 Iterating over list elements in HPPC for (IntCursor c : list) { System.out.println(c.index + ": " + c.value); }...or list.foreach(new IntProcedure() { public void apply(int value) { System.out.println(value); } });

97 Iterating over list elements in HPPC for (IntCursor c : list) { System.out.println(c.index + ": " + c.value); }...or list.foreach(new IntProcedure() { public void apply(int value) { System.out.println(value); } });...or final int [] buffer = list.buffer; final int size = list.size(); for (int i = 0; i < size; i++) { System.out.println(i + ": " + buffer[i]); }

98 The fastest one?

99

100

101 What s in HPPC?

102

103 Open implementation is good.

104 /** * Applies a supplemental hash function to a given * hashcode, which defends against poor quality * hash functions. [...] */ static int hash(int h) { // This function ensures that hashcodes that differ only by // constant multiples at each bit position have a bounded // number of collisions (approximately 8 at default load factor). h ^= (h >>> 20) ^ (h >>> 12); return h ^ (h >>> 7) ^ (h >>> 4); } HashMap rehashes your (carefully crafted) hash code.

105 HPPC approach (example): public class LongIntOpenHashMap implements LongIntMap { //... public LongIntOpenHashMap(int initialcapacity, float loadfactor, LongHashFunction keyhashfunction, IntHashFunction valuehashfunction) { //... } Defaults: LongMurmurHash, IntHashFunction.

106 Example 7 Frequency count of character bigrams in a given text.

107 HPPC: final char [] CHARS = DATA; final IntIntOpenHashMap counts = new IntIntOpenHashMap(); for (int i = 0; i < CHARS.length - 1; i++) { counts.putoradd((chars[i] << 16 CHARS[i + 1]), 1, 1); } JCF, boxed integer types. final Integer currentcount = map.get(bigram); map.put(bigram, currentcount == null? 1 : currentcount + 1); JCF, with IntHolder (mutable value object). GNU Trove map.adjustorputvalue(bigram, 1, 1); fastutil, OpenHashMap and LinkedOpenHashMap map.put(bigram, map.get(bigram) + 1); PCJ, OpenHashMap and ChainedHashMap

108

109

110 Is Java faster than C/C++? The short answer is: it depends. Cliff Click

111 Example 8 The same algorithm for building a DFSA automaton accepting a set of strings. Input: strings, 158M of text.

112 Example 8 The same algorithm for building a DFSA automaton accepting a set of strings. Input: strings, 158M of text. real user sys gcc -O2 java 1.6.0_20-64

113 Example 8 The same algorithm for building a DFSA automaton accepting a set of strings. Input: strings, 158M of text. gcc -O2 real s user s sys 0.240s java 1.6.0_20-64

114 Example 8 The same algorithm for building a DFSA automaton accepting a set of strings. Input: strings, 158M of text. gcc -O2 java 1.6.0_20-64 real s s user s s sys 0.240s 0.840s

115 Summary and Conclusions

116 Performance checklist (sanity check) Algorithms, algorithms, algorithms. Proper data structures. Spurious GC activity. Memory barriers in tight loops. CPU cache utilization. Low-level, hotspot-specific code structuring.

117 HPPC and junit-benchmarks are at:

Lecture 7: Machine-Level Programming I: Basics Mohamed Zahran (aka Z) mzahran@cs.nyu.edu http://www.mzahran.com

Lecture 7: Machine-Level Programming I: Basics Mohamed Zahran (aka Z) mzahran@cs.nyu.edu http://www.mzahran.com CSCI-UA.0201-003 Computer Systems Organization Lecture 7: Machine-Level Programming I: Basics Mohamed Zahran (aka Z) mzahran@cs.nyu.edu http://www.mzahran.com Some slides adapted (and slightly modified)

More information

First Java Programs. V. Paúl Pauca. CSC 111D Fall, 2015. Department of Computer Science Wake Forest University. Introduction to Computer Science

First Java Programs. V. Paúl Pauca. CSC 111D Fall, 2015. Department of Computer Science Wake Forest University. Introduction to Computer Science First Java Programs V. Paúl Pauca Department of Computer Science Wake Forest University CSC 111D Fall, 2015 Hello World revisited / 8/23/15 The f i r s t o b l i g a t o r y Java program @author Paul Pauca

More information

Java and the JVM. Martin Schöberl

Java and the JVM. Martin Schöberl Java and the JVM Martin Schöberl Overview History and Java features Java technology The Java language A first look into the JVM Disassembling of.class files Java and the JVM 2 History of a Young Java 1992

More information

Interpreters and virtual machines. Interpreters. Interpreters. Why interpreters? Tree-based interpreters. Text-based interpreters

Interpreters and virtual machines. Interpreters. Interpreters. Why interpreters? Tree-based interpreters. Text-based interpreters Interpreters and virtual machines Michel Schinz 2007 03 23 Interpreters Interpreters Why interpreters? An interpreter is a program that executes another program, represented as some kind of data-structure.

More information

Crash Course in Java

Crash Course in Java Crash Course in Java Based on notes from D. Hollinger Based in part on notes from J.J. Johns also: Java in a Nutshell Java Network Programming and Distributed Computing Netprog 2002 Java Intro 1 What is

More information

Introduction to Java

Introduction to Java Introduction to Java The HelloWorld program Primitive data types Assignment and arithmetic operations User input Conditional statements Looping Arrays CSA0011 Matthew Xuereb 2008 1 Java Overview A high

More information

Java Interview Questions and Answers

Java Interview Questions and Answers 1. What is the most important feature of Java? Java is a platform independent language. 2. What do you mean by platform independence? Platform independence means that we can write and compile the java

More information

Java Coding Practices for Improved Application Performance

Java Coding Practices for Improved Application Performance 1 Java Coding Practices for Improved Application Performance Lloyd Hagemo Senior Director Application Infrastructure Management Group Candle Corporation In the beginning, Java became the language of the

More information

14/05/2013 Ed Merks EDL V1.0 1

14/05/2013 Ed Merks EDL V1.0 1 14/05/2013 Ed Merks EDL V1.0 1 Java Performance is Complex Write once run everywhere Java is slow because it s interpreted No, there are Just In Time (JIT) compilers Different hardware and platforms Different

More information

CS3813 Performance Monitoring Project

CS3813 Performance Monitoring Project CS3813 Performance Monitoring Project Owen Kaser October 8, 2014 1 Introduction In this project, you should spend approximately 20 hours to experiment with Intel performance monitoring facilities, and

More information

A JVM Does What? Eva Andreasson Product Manager, Azul Systems

A JVM Does What? Eva Andreasson Product Manager, Azul Systems A JVM Does What? Eva Andreasson Product Manager, Azul Systems Presenter Eva Andreasson Innovator & Problem solver Implemented the Deterministic GC of JRockit Real Time Awarded patents on GC heuristics

More information

Java Review (Essentials of Java for Hadoop)

Java Review (Essentials of Java for Hadoop) Java Review (Essentials of Java for Hadoop) Have You Joined Our LinkedIn Group? What is Java? Java JRE - Java is not just a programming language but it is a complete platform for object oriented programming.

More information

Characteristics of Java (Optional) Y. Daniel Liang Supplement for Introduction to Java Programming

Characteristics of Java (Optional) Y. Daniel Liang Supplement for Introduction to Java Programming Characteristics of Java (Optional) Y. Daniel Liang Supplement for Introduction to Java Programming Java has become enormously popular. Java s rapid rise and wide acceptance can be traced to its design

More information

Handout 1. Introduction to Java programming language. Java primitive types and operations. Reading keyboard Input using class Scanner.

Handout 1. Introduction to Java programming language. Java primitive types and operations. Reading keyboard Input using class Scanner. Handout 1 CS603 Object-Oriented Programming Fall 15 Page 1 of 11 Handout 1 Introduction to Java programming language. Java primitive types and operations. Reading keyboard Input using class Scanner. Java

More information

CSC230 Getting Starting in C. Tyler Bletsch

CSC230 Getting Starting in C. Tyler Bletsch CSC230 Getting Starting in C Tyler Bletsch What is C? The language of UNIX Procedural language (no classes) Low-level access to memory Easy to map to machine language Not much run-time stuff needed Surprisingly

More information

Can You Trust Your JVM Diagnostic Tools?

Can You Trust Your JVM Diagnostic Tools? Can You Trust Your JVM Diagnostic Tools? Isaac Sjoblom, Tim S. Snyder, and Elena Machkasova Computer Science Discipline University of Minnesota Morris Morris, MN 56267 sjobl014@umn.edu, snyde479@umn.edu,

More information

MPI and C-Language Seminars 2010

MPI and C-Language Seminars 2010 MPI and C-Language Seminars 2010 Seminar Plan (1/3) Aim: Introduce the C Programming Language. Plan to cover: Basic C, and programming techniques needed for HPC coursework. C-bindings for the Message Passing

More information

Use of profilers for studying Java dynamic optimizations

Use of profilers for studying Java dynamic optimizations Use of profilers for studying Java dynamic optimizations Kevin Arhelger, Fernando Trinciante, Elena Machkasova Computer Science Discipline University of Minnesota Morris Morris MN, 56267 arhel005@umn.edu,

More information

Extreme Performance with Java

Extreme Performance with Java Extreme Performance with Java QCon NYC - June 2012 Charlie Hunt Architect, Performance Engineering Salesforce.com sfdc_ppt_corp_template_01_01_2012.ppt In a Nutshell What you need to know about a modern

More information

Just in Time Compilation. Louis Croce

Just in Time Compilation. Louis Croce Just in Time Compilation Louis Croce JIT Compilation: What is it? Compilation done during execution of a program (at run time) rather than prior to execution -Wikipedia Seen in today s JVMs and elsewhere

More information

Jonathan Worthington Scarborough Linux User Group

Jonathan Worthington Scarborough Linux User Group Jonathan Worthington Scarborough Linux User Group Introduction What does a Virtual Machine do? Hides away the details of the hardware platform and operating system. Defines a common set of instructions.

More information

Habanero Extreme Scale Software Research Project

Habanero Extreme Scale Software Research Project Habanero Extreme Scale Software Research Project Comp215: Java Method Dispatch Zoran Budimlić (Rice University) Always remember that you are absolutely unique. Just like everyone else. - Margaret Mead

More information

Course: Introduction to Java Using Eclipse Training

Course: Introduction to Java Using Eclipse Training Course: Introduction to Java Using Eclipse Training Course Length: Duration: 5 days Course Code: WA1278 DESCRIPTION: This course introduces the Java programming language and how to develop Java applications

More information

Multithreading in Java

Multithreading in Java Multithreading in Java Nelson Padua-Perez Bill Pugh Department of Computer Science University of Maryland, College Park Problem Multiple tasks for computer Draw & display images on screen Check keyboard

More information

Tail call elimination. Michel Schinz

Tail call elimination. Michel Schinz Tail call elimination Michel Schinz Tail calls and their elimination Loops in functional languages Several functional programming languages do not have an explicit looping statement. Instead, programmers

More information

Embedded Java too fat and too slow?

Embedded Java too fat and too slow? Embedded Java too fat and too slow? Abstract In software developer communities it is one of the most often discussed questions: Is Java really to fat and too slow?. For embedded devices this discussion

More information

Lecture Set 2: Starting Java

Lecture Set 2: Starting Java Lecture Set 2: Starting Java 1. Java Concepts 2. Java Programming Basics 3. User output 4. Variables and types 5. Expressions 6. User input 7. Uninitialized Variables CMSC 131 - Lecture Outlines - set

More information

JVM memory model. Global Overview

JVM memory model. Global Overview JVM memory model The leitmotiv of JAVA is its famous WOTA: write once, run anywhere. In order to apply it, Sun Microsystems created the Java Virtual Machine, an abstraction of the underlying OS that interprets

More information

Architecture of software systems

Architecture of software systems Architecture of software systems Course 10: Data structures, memory management, garbage collector, references David Šišlák david.sislak@fel.cvut.cz Data structures» primitives: boolean, byte, char, int,

More information

Java CPD (I) Frans Coenen Department of Computer Science

Java CPD (I) Frans Coenen Department of Computer Science Java CPD (I) Frans Coenen Department of Computer Science Content Session 1, 12:45-14:30 (First Java Programme, Inheritance, Arithmetic) Session 2, 14:45-16:45 (Input and Programme Constructs) Materials

More information

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. Exam Name MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. 1) The JDK command to compile a class in the file Test.java is A) java Test.java B) java

More information

Java (Micro) Performance Measuring

Java (Micro) Performance Measuring Java (Micro) Performance Measuring trendscope.com How to measure and test the performance of Java applications Java (Micro) Performance Measuring Thomas Uhrig Akt. Themen des Software-Engineerings 1 of

More information

Validating Java for Safety-Critical Applications

Validating Java for Safety-Critical Applications Validating Java for Safety-Critical Applications Jean-Marie Dautelle * Raytheon Company, Marlborough, MA, 01752 With the real-time extensions, Java can now be used for safety critical systems. It is therefore

More information

Advanced compiler construction. General course information. Teacher & assistant. Course goals. Evaluation. Grading scheme. Michel Schinz 2007 03 16

Advanced compiler construction. General course information. Teacher & assistant. Course goals. Evaluation. Grading scheme. Michel Schinz 2007 03 16 Advanced compiler construction Michel Schinz 2007 03 16 General course information Teacher & assistant Course goals Teacher: Michel Schinz Michel.Schinz@epfl.ch Assistant: Iulian Dragos INR 321, 368 64

More information

C# and Other Languages

C# and Other Languages C# and Other Languages Rob Miles Department of Computer Science Why do we have lots of Programming Languages? Different developer audiences Different application areas/target platforms Graphics, AI, List

More information

Chapter 7D The Java Virtual Machine

Chapter 7D The Java Virtual Machine This sub chapter discusses another architecture, that of the JVM (Java Virtual Machine). In general, a VM (Virtual Machine) is a hypothetical machine (implemented in either hardware or software) that directly

More information

qwertyuiopasdfghjklzxcvbnmqwerty uiopasdfghjklzxcvbnmqwertyuiopasd fghjklzxcvbnmqwertyuiopasdfghjklzx cvbnmqwertyuiopasdfghjklzxcvbnmq

qwertyuiopasdfghjklzxcvbnmqwerty uiopasdfghjklzxcvbnmqwertyuiopasd fghjklzxcvbnmqwertyuiopasdfghjklzx cvbnmqwertyuiopasdfghjklzxcvbnmq qwertyuiopasdfghjklzxcvbnmqwerty uiopasdfghjklzxcvbnmqwertyuiopasd fghjklzxcvbnmqwertyuiopasdfghjklzx cvbnmqwertyuiopasdfghjklzxcvbnmq Introduction to Programming using Java wertyuiopasdfghjklzxcvbnmqwertyui

More information

Lecture 1 Introduction to Android

Lecture 1 Introduction to Android These slides are by Dr. Jaerock Kwon at. The original URL is http://kettering.jrkwon.com/sites/default/files/2011-2/ce-491/lecture/alecture-01.pdf so please use that instead of pointing to this local copy

More information

The first step in solving a problem recursively is to formulate a recursive definition of the problem.

The first step in solving a problem recursively is to formulate a recursive definition of the problem. Chapter 8 Recursion The subject of this chapter is recursion, an implicit application of the stack ADT. A recursive method is a method that carries out its task by making a call(s) to itself. Each recursive

More information

Java Native Interface

Java Native Interface Java Native Interface Application Notes Da Ke 4/5/2009 ECE 480 Spring 2009, Design Team 3 Department of Electrical and Computer Engineering Michigan State University Abstract Java is one of most widely

More information

Practical Performance Understanding the Performance of Your Application

Practical Performance Understanding the Performance of Your Application Neil Masson IBM Java Service Technical Lead 25 th September 2012 Practical Performance Understanding the Performance of Your Application 1 WebSphere User Group: Practical Performance Understand the Performance

More information

An Overview of Java. overview-1

An Overview of Java. overview-1 An Overview of Java overview-1 Contents What is Java Major Java features Java virtual machine Java programming language Java class libraries (API) GUI Support in Java Networking and Threads in Java overview-2

More information

Java Programming Fundamentals

Java Programming Fundamentals Lecture 1 Part I Java Programming Fundamentals Topics in Quantitative Finance: Numerical Solutions of Partial Differential Equations Instructor: Iraj Kani Introduction to Java We start by making a few

More information

General Introduction

General Introduction Managed Runtime Technology: General Introduction Xiao-Feng Li (xiaofeng.li@gmail.com) 2012-10-10 Agenda Virtual machines Managed runtime systems EE and MM (JIT and GC) Summary 10/10/2012 Managed Runtime

More information

Language Based Virtual Machines... or why speed matters. by Lars Bak, Google Inc

Language Based Virtual Machines... or why speed matters. by Lars Bak, Google Inc Language Based Virtual Machines... or why speed matters by Lars Bak, Google Inc Agenda Motivation for virtual machines HotSpot V8 Dart What I ve learned Background 25+ years optimizing implementations

More information

OCaml as fast as C. Sylvain Le Gall, OCamlCore SARL, OCaml Meeting 2009 Grenoble, France 2008/05/30 11:00 1

OCaml as fast as C. Sylvain Le Gall, OCamlCore SARL, OCaml Meeting 2009 Grenoble, France 2008/05/30 11:00 1 OCaml as fast as C Sylvain Le Gall, OCamlCore SARL, OCaml Meeting 2009 Grenoble, France 2008/05/30 11:00 1 Plan Project workflow Optimize Tips and tricks Foreword This presentation is based on the project

More information

CPLEX Tutorial Handout

CPLEX Tutorial Handout CPLEX Tutorial Handout What Is ILOG CPLEX? ILOG CPLEX is a tool for solving linear optimization problems, commonly referred to as Linear Programming (LP) problems, of the form: Maximize (or Minimize) c

More information

Zend Server 4.0 Beta 2 Release Announcement What s new in Zend Server 4.0 Beta 2 Updates and Improvements Resolved Issues Installation Issues

Zend Server 4.0 Beta 2 Release Announcement What s new in Zend Server 4.0 Beta 2 Updates and Improvements Resolved Issues Installation Issues Zend Server 4.0 Beta 2 Release Announcement Thank you for your participation in the Zend Server 4.0 beta program. Your involvement will help us ensure we best address your needs and deliver even higher

More information

Optimizing Java* and Apache Hadoop* for Intel Architecture

Optimizing Java* and Apache Hadoop* for Intel Architecture WHITE PAPER Intel Xeon Processors Optimizing and Apache Hadoop* Optimizing and Apache Hadoop* for Intel Architecture With the ability to analyze virtually unlimited amounts of unstructured and semistructured

More information

The Java Series. Java Essentials I What is Java? Basic Language Constructs. Java Essentials I. What is Java?. Basic Language Constructs Slide 1

The Java Series. Java Essentials I What is Java? Basic Language Constructs. Java Essentials I. What is Java?. Basic Language Constructs Slide 1 The Java Series Java Essentials I What is Java? Basic Language Constructs Slide 1 What is Java? A general purpose Object Oriented programming language. Created by Sun Microsystems. It s a general purpose

More information

Building Applications Using Micro Focus COBOL

Building Applications Using Micro Focus COBOL Building Applications Using Micro Focus COBOL Abstract If you look through the Micro Focus COBOL documentation, you will see many different executable file types referenced: int, gnt, exe, dll and others.

More information

The Fundamentals of Tuning OpenJDK

The Fundamentals of Tuning OpenJDK The Fundamentals of Tuning OpenJDK OSCON 2013 Portland, OR Charlie Hunt Architect, Performance Engineering Salesforce.com sfdc_ppt_corp_template_01_01_2012.ppt In a Nutshell What you need to know about

More information

Topics. Introduction. Java History CS 146. Introduction to Programming and Algorithms Module 1. Module Objectives

Topics. Introduction. Java History CS 146. Introduction to Programming and Algorithms Module 1. Module Objectives Introduction to Programming and Algorithms Module 1 CS 146 Sam Houston State University Dr. Tim McGuire Module Objectives To understand: the necessity of programming, differences between hardware and software,

More information

Using jvmstat and visualgc to Solve Memory Management Problems

Using jvmstat and visualgc to Solve Memory Management Problems Using jvmstat and visualgc to Solve Memory Management Problems java.sun.com/javaone/sf 1 Wally Wedel Sun Software Services Brian Doherty Sun Microsystems, Inc. Analyze JVM Machine Memory Management Problems

More information

Chapter 1 Java Program Design and Development

Chapter 1 Java Program Design and Development presentation slides for JAVA, JAVA, JAVA Object-Oriented Problem Solving Third Edition Ralph Morelli Ralph Walde Trinity College Hartford, CT published by Prentice Hall Java, Java, Java Object Oriented

More information

CS 106 Introduction to Computer Science I

CS 106 Introduction to Computer Science I CS 106 Introduction to Computer Science I 01 / 21 / 2014 Instructor: Michael Eckmann Today s Topics Introduction Homework assignment Review the syllabus Review the policies on academic dishonesty and improper

More information

A Comparison of the Basic Syntax of Python and Java

A Comparison of the Basic Syntax of Python and Java Python Python supports many (but not all) aspects of object-oriented programming; but it is possible to write a Python program without making any use of OO concepts. Python is designed to be used interpretively.

More information

Embedded Software Development

Embedded Software Development Linköpings Tekniska Högskola Institutionen för Datavetanskap (IDA), Software and Systems (SaS) TDDI11, Embedded Software 2010-04-22 Embedded Software Development Host and Target Machine Typical embedded

More information

What s Cool in the SAP JVM (CON3243)

What s Cool in the SAP JVM (CON3243) What s Cool in the SAP JVM (CON3243) Volker Simonis, SAP SE September, 2014 Public Agenda SAP JVM Supportability SAP JVM Profiler SAP JVM Debugger 2014 SAP SE. All rights reserved. Public 2 SAP JVM SAP

More information

CSC 551: Web Programming. Spring 2004

CSC 551: Web Programming. Spring 2004 CSC 551: Web Programming Spring 2004 Java Overview Design goals & features platform independence, portable, secure, simple, object-oriented, Programming models applications vs. applets vs. servlets intro

More information

CS 2112 Spring 2014. 0 Instructions. Assignment 3 Data Structures and Web Filtering. 0.1 Grading. 0.2 Partners. 0.3 Restrictions

CS 2112 Spring 2014. 0 Instructions. Assignment 3 Data Structures and Web Filtering. 0.1 Grading. 0.2 Partners. 0.3 Restrictions CS 2112 Spring 2014 Assignment 3 Data Structures and Web Filtering Due: March 4, 2014 11:59 PM Implementing spam blacklists and web filters requires matching candidate domain names and URLs very rapidly

More information

CS 141: Introduction to (Java) Programming: Exam 1 Jenny Orr Willamette University Fall 2013

CS 141: Introduction to (Java) Programming: Exam 1 Jenny Orr Willamette University Fall 2013 Oct 4, 2013, p 1 Name: CS 141: Introduction to (Java) Programming: Exam 1 Jenny Orr Willamette University Fall 2013 1. (max 18) 4. (max 16) 2. (max 12) 5. (max 12) 3. (max 24) 6. (max 18) Total: (max 100)

More information

1.00 Lecture 1. Course information Course staff (TA, instructor names on syllabus/faq): 2 instructors, 4 TAs, 2 Lab TAs, graders

1.00 Lecture 1. Course information Course staff (TA, instructor names on syllabus/faq): 2 instructors, 4 TAs, 2 Lab TAs, graders 1.00 Lecture 1 Course Overview Introduction to Java Reading for next time: Big Java: 1.1-1.7 Course information Course staff (TA, instructor names on syllabus/faq): 2 instructors, 4 TAs, 2 Lab TAs, graders

More information

Object Oriented Software Design

Object Oriented Software Design Object Oriented Software Design Introduction to Java - II Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa October 28, 2010 G. Lipari (Scuola Superiore Sant Anna) Introduction

More information

INTRODUCTION TO JAVA PROGRAMMING LANGUAGE

INTRODUCTION TO JAVA PROGRAMMING LANGUAGE INTRODUCTION TO JAVA PROGRAMMING LANGUAGE Today Java programming language is one of the most popular programming language which is used in critical applications like stock market trading system on BSE,

More information

02 B The Java Virtual Machine

02 B The Java Virtual Machine 02 B The Java Virtual Machine CS1102S: Data Structures and Algorithms Martin Henz January 22, 2010 Generated on Friday 22 nd January, 2010, 09:46 CS1102S: Data Structures and Algorithms 02 B The Java Virtual

More information

Lecture 5: MIPS Examples

Lecture 5: MIPS Examples Lecture 5: MIPS Examples Today s topics: the compilation process full example sort in C Reminder: 2 nd assignment will be posted later today 1 Dealing with Characters Instructions are also provided to

More information

Optimizing Generation of Object Graphs in Java PathFinder

Optimizing Generation of Object Graphs in Java PathFinder Optimizing Generation of Object Graphs in Java PathFinder Milos Gligoric, Tihomir Gvero, Steven Lauterburg, Darko Marinov, Sarfraz Khurshid JPF Workshop 1.5.8 Bugs Six Decades Ago 1947: Harvard Mark II

More information

Metrics for Success: Performance Analysis 101

Metrics for Success: Performance Analysis 101 Metrics for Success: Performance Analysis 101 February 21, 2008 Kuldip Oberoi Developer Tools Sun Microsystems, Inc. 1 Agenda Application Performance Compiling for performance Profiling for performance

More information

Effective Java Programming. efficient software development

Effective Java Programming. efficient software development Effective Java Programming efficient software development Structure efficient software development what is efficiency? development process profiling during development what determines the performance of

More information

Lecture 03 Bits, Bytes and Data Types

Lecture 03 Bits, Bytes and Data Types Lecture 03 Bits, Bytes and Data Types In this lecture Computer Languages Assembly Language The compiler Operating system Data and program instructions Bits, Bytes and Data Types ASCII table Data Types

More information

Virtual Machines. www.viplavkambli.com

Virtual Machines. www.viplavkambli.com 1 Virtual Machines A virtual machine (VM) is a "completely isolated guest operating system installation within a normal host operating system". Modern virtual machines are implemented with either software

More information

C Compiler Targeting the Java Virtual Machine

C Compiler Targeting the Java Virtual Machine C Compiler Targeting the Java Virtual Machine Jack Pien Senior Honors Thesis (Advisor: Javed A. Aslam) Dartmouth College Computer Science Technical Report PCS-TR98-334 May 30, 1998 Abstract One of the

More information

picojava TM : A Hardware Implementation of the Java Virtual Machine

picojava TM : A Hardware Implementation of the Java Virtual Machine picojava TM : A Hardware Implementation of the Java Virtual Machine Marc Tremblay and Michael O Connor Sun Microelectronics Slide 1 The Java picojava Synergy Java s origins lie in improving the consumer

More information

A Thread Monitoring System for Multithreaded Java Programs

A Thread Monitoring System for Multithreaded Java Programs A Thread Monitoring System for Multithreaded Java Programs Sewon Moon and Byeong-Mo Chang Department of Computer Science Sookmyung Women s University, Seoul 140-742, Korea wonsein@nate.com, chang@sookmyung.ac.kr

More information

From Java Code to Java Heap Understanding the Memory Usage of Your Application

From Java Code to Java Heap Understanding the Memory Usage of Your Application Paul Cheeseman IBM Java L3 Service Engineer From Java Code to Java Heap Understanding the Memory Usage of Your Application 2011 IBM Corporation Important Disclaimers THE INFORMATION CONTAINED IN THIS PRESENTATION

More information

Multi-core architectures. Jernej Barbic 15-213, Spring 2007 May 3, 2007

Multi-core architectures. Jernej Barbic 15-213, Spring 2007 May 3, 2007 Multi-core architectures Jernej Barbic 15-213, Spring 2007 May 3, 2007 1 Single-core computer 2 Single-core CPU chip the single core 3 Multi-core architectures This lecture is about a new trend in computer

More information

Introduction to C Programming S Y STEMS

Introduction to C Programming S Y STEMS Introduction to C Programming CS 40: INTRODUCTION TO U NIX A ND L I NUX O P E R AT ING S Y STEMS Objectives Introduce C programming, including what it is and what it contains, which includes: Command line

More information

Instrumentation Software Profiling

Instrumentation Software Profiling Instrumentation Software Profiling Software Profiling Instrumentation of a program so that data related to runtime performance (e.g execution time, memory usage) is gathered for one or more pieces of the

More information

Parrot in a Nutshell. Dan Sugalski dan@sidhe.org. Parrot in a nutshell 1

Parrot in a Nutshell. Dan Sugalski dan@sidhe.org. Parrot in a nutshell 1 Parrot in a Nutshell Dan Sugalski dan@sidhe.org Parrot in a nutshell 1 What is Parrot The interpreter for perl 6 A multi-language virtual machine An April Fools joke gotten out of hand Parrot in a nutshell

More information

Parallel Processing and Software Performance. Lukáš Marek

Parallel Processing and Software Performance. Lukáš Marek Parallel Processing and Software Performance Lukáš Marek DISTRIBUTED SYSTEMS RESEARCH GROUP http://dsrg.mff.cuni.cz CHARLES UNIVERSITY PRAGUE Faculty of Mathematics and Physics Benchmarking in parallel

More information

11.1 inspectit. 11.1. inspectit

11.1 inspectit. 11.1. inspectit 11.1. inspectit Figure 11.1. Overview on the inspectit components [Siegl and Bouillet 2011] 11.1 inspectit The inspectit monitoring tool (website: http://www.inspectit.eu/) has been developed by NovaTec.

More information

Fachbereich Informatik und Elektrotechnik SunSPOT. Ubiquitous Computing. Ubiquitous Computing, Helmut Dispert

Fachbereich Informatik und Elektrotechnik SunSPOT. Ubiquitous Computing. Ubiquitous Computing, Helmut Dispert Ubiquitous Computing Ubiquitous Computing The Sensor Network System Sun SPOT: The Sun Small Programmable Object Technology Technology-Based Wireless Sensor Networks a Java Platform for Developing Applications

More information

Performance Improvement In Java Application

Performance Improvement In Java Application Performance Improvement In Java Application Megha Fulfagar Accenture Delivery Center for Technology in India Accenture, its logo, and High Performance Delivered are trademarks of Accenture. Agenda Performance

More information

Chapter 1: Introducing Java

Chapter 1: Introducing Java Chapter 1: Introducing Java 1. What is Java? Java is a programming language offering many features that make it attractive for mathematical illustration. First, it is a high-level language providing a

More information

JAVA PRIMITIVE DATA TYPE

JAVA PRIMITIVE DATA TYPE JAVA PRIMITIVE DATA TYPE Description Not everything in Java is an object. There is a special group of data types (also known as primitive types) that will be used quite often in programming. For performance

More information

Systems software design SOFTWARE BUILD CONFIGURATIONS; DEBUGGING, PROFILING & QUALITY ASSURANCE TOOLS

Systems software design SOFTWARE BUILD CONFIGURATIONS; DEBUGGING, PROFILING & QUALITY ASSURANCE TOOLS Systems software design SOFTWARE BUILD CONFIGURATIONS; DEBUGGING, PROFILING & QUALITY ASSURANCE TOOLS outline Build configurations Debugging tools Debugger features Remote debugging Post-mortem analysis

More information

GMP implementation on CUDA - A Backward Compatible Design With Performance Tuning

GMP implementation on CUDA - A Backward Compatible Design With Performance Tuning 1 GMP implementation on CUDA - A Backward Compatible Design With Performance Tuning Hao Jun Liu, Chu Tong Edward S. Rogers Sr. Department of Electrical and Computer Engineering University of Toronto haojun.liu@utoronto.ca,

More information

OPTIMISING JAVA PROGRAMS THROUGH BASIC BLOCK DYNAMIC COMPILATION

OPTIMISING JAVA PROGRAMS THROUGH BASIC BLOCK DYNAMIC COMPILATION OPTIMISING JAVA PROGRAMS THROUGH BASIC BLOCK DYNAMIC COMPILATION A modified version of a thesis submitted to the University of Manchester for the degree of Doctor of Philosophy in the Faculty of Science

More information

School of Informatics, University of Edinburgh

School of Informatics, University of Edinburgh CS1Bh Lecture Note 7 Compilation I: Java Byte Code High-level programming languages are compiled to equivalent low-level programs which are executed on a given machine. The process of compiling a program

More information

I Control Your Code Attack Vectors Through the Eyes of Software-based Fault Isolation. Mathias Payer, ETH Zurich

I Control Your Code Attack Vectors Through the Eyes of Software-based Fault Isolation. Mathias Payer, ETH Zurich I Control Your Code Attack Vectors Through the Eyes of Software-based Fault Isolation Mathias Payer, ETH Zurich Motivation Applications often vulnerable to security exploits Solution: restrict application

More information

Eclipse Visualization and Performance Monitoring

Eclipse Visualization and Performance Monitoring Eclipse Visualization and Performance Monitoring Chris Laffra IBM Ottawa Labs http://eclipsefaq.org/chris Chris Laffra Eclipse Visualization and Performance Monitoring Page 1 Roadmap Introduction Introspection

More information

Programming Languages

Programming Languages Programming Languages In the beginning To use a computer, you needed to know how to program it. Today People no longer need to know how to program in order to use the computer. To see how this was accomplished,

More information

Software Engineering Techniques

Software Engineering Techniques Software Engineering Techniques Low level design issues for programming-in-the-large. Software Quality Design by contract Pre- and post conditions Class invariants Ten do Ten do nots Another type of summary

More information

Lecture 3: Evaluating Computer Architectures. Software & Hardware: The Virtuous Cycle?

Lecture 3: Evaluating Computer Architectures. Software & Hardware: The Virtuous Cycle? Lecture 3: Evaluating Computer Architectures Announcements - Reminder: Homework 1 due Thursday 2/2 Last Time technology back ground Computer elements Circuits and timing Virtuous cycle of the past and

More information

An Introduction to the Java Programming Language History of Java

An Introduction to the Java Programming Language History of Java An Introduction to the Java Programming Language History of Java In 1991, a group of Sun Microsystems engineers led by James Gosling decided to develop a language for consumer devices (cable boxes, etc.).

More information

HPC performance applications on Virtual Clusters

HPC performance applications on Virtual Clusters Panagiotis Kritikakos EPCC, School of Physics & Astronomy, University of Edinburgh, Scotland - UK pkritika@epcc.ed.ac.uk 4 th IC-SCCE, Athens 7 th July 2010 This work investigates the performance of (Java)

More information

Mac OS X and Mac Demos - The Opportunities

Mac OS X and Mac Demos - The Opportunities (Corrections 190301) Introduction Mac OS X and Mac Demos - The Opportunities Mac OS X looks like another milestone in the development of the Apple Macintosh computer. In this short article we look at the

More information

Tutorial: Getting Started

Tutorial: Getting Started 9 Tutorial: Getting Started INFRASTRUCTURE A MAKEFILE PLAIN HELLO WORLD APERIODIC HELLO WORLD PERIODIC HELLO WORLD WATCH THOSE REAL-TIME PRIORITIES THEY ARE SERIOUS SUMMARY Getting started with a new platform

More information

Monitoring, Tracing, Debugging (Under Construction)

Monitoring, Tracing, Debugging (Under Construction) Monitoring, Tracing, Debugging (Under Construction) I was already tempted to drop this topic from my lecture on operating systems when I found Stephan Siemen's article "Top Speed" in Linux World 10/2003.

More information