JVM Warm-Up Overhead in Data-Parallel Systems

Total Page:16

File Type:pdf, Size:1020Kb

JVM Warm-Up Overhead in Data-Parallel Systems DON’T GET CAUGHT IN THE COLD,WARM-UP YOUR JVM: UNDERSTAND AND ELIMINATE JVM WARM-UP OVERHEAD IN DATA-PARALLEL SYSTEMS by David Lion A thesis submitted in conformity with the requirements for the degree of Master of Applied Science Graduate Department of Electrical and Computer Engineering University of Toronto c Copyright 2017 by David Lion Abstract Don’t Get Caught in the Cold, Warm-up Your JVM: Understand and Eliminate JVM Warm-up Overhead in Data-Parallel Systems David Lion Master of Applied Science Graduate Department of Electrical and Computer Engineering University of Toronto 2017 Many widely used, latency sensitive, data-parallel distributed systems, such as HDFS, Hive, and Spark choose to use the Java Virtual Machine (JVM), despite debate on the overhead of doing so. This thesis analyzes the extent and causes of the JVM performance overhead in the above mentioned systems. Surprisingly, we find that the warm-up overhead is frequently the bottleneck, taking 33% of execution time for a 1GB HDFS read, and an average of 21 seconds for Spark queries. The findings on JVM warm-up overhead reveal a contradiction between the principle of parallelization, i.e., speeding up long running jobs by parallelizing them into short tasks, and amortizing JVM warm-up overhead through long tasks. We solve this problem by designing HotTub, a modified JVM that amortizes the warm-up overhead over the lifetime of a cluster node instead of over a single job. ii Acknowledgements First, I would like to thank my supervisor Professor Ding Yuan for his constant support and guidance. His unrivalled dedication to his students is largely responsible for any of my success or personal growth over the last few years. I would also like to thank him for accepting me as a graduate student and taking a chance on me when I did not deserve it. Second, I would like to thank the many people involved in the OSDI paper this work is based on. The co- authors of the paper, Adrian Chiu, Hailong Sun, Xin Zhuang, and Nikola Grcevski for their hard work on the paper this thesis is based on. Especially, Adrian Chiu whose incredible dedication was paramount in the success of this work. Yu Luo, Serhei Makarov, Michael Stumm, Jenny Ren, Kirk Rodrigues, Guangji Xu, Yongle Zhang, and Xu Zhao for the useful and thought stimulating discussions. Especially, Yu Luo for setting up and maintaining the server cluster environment used in our experiments. The anonymous reviewers of the paper and its shepherd, Prof. Andrea Arpaci-Dusseau, for their insightful feedback. Working with all of these people has been a pleasure and I owe much to them. I would also like to thank my thesis committee members, Professor Michael Stumm, Professor Tarek Abdelrahman, and Professor Ben Liang for their feedback and insights. Lastly, I would like to thank my friends and family for always supporting and encouraging me in my pursuits. iii Contents 1 Introduction 1 2 Background 5 2.1 Java Virtual Machine . .5 2.1.1 Class Loading . .5 2.1.2 Interpretation . .6 2.2 Systems . .7 2.2.1 Hadoop Distributed File System (HDFS) . .7 2.2.2 MapReduce and YARN . .8 2.2.3 Hive and Tez . .8 2.2.4 Spark . .9 2.3 Blocked Time Analysis . .9 3 Measure Warm-up Overhead 11 4 Analysis of Warm-up Overhead 13 4.1 Methodology . 13 4.2 HDFS . 15 4.3 Spark versus Hive . 18 4.4 Summary of Findings . 19 4.5 Industry Practices . 19 5 Design of HotTub 22 5.1 Maintain Consistency . 24 5.2 Limitations . 26 6 Implementation of HotTub 28 iv 7 Performance of HotTub 30 7.1 Speed-up . 30 7.2 Sensitivity to Difference in Workload . 33 7.3 Management Overhead . 33 8 Related Work 35 9 Concluding Remarks 37 9.1 Future Work . 37 Bibliography 39 v List of Tables 4.1 Breakdown of class loading time. 17 7.1 Performance improvements by comparing the average job completion time of an unmodified JVM and HotTub. For Spark and Hive we report the average times of the queries with the, best, median, and worst speed-up for each data size. 30 7.2 Comparing cache, TLB, and branch misses between HotTub (H) and an unmodified JVM (U) when running query 11 of BigBench on Spark with 100GB data size. The numbers are taken from the average of five runs. All page faults are minor faults. “Rate diff.” is calculated as (U Rate - H Rate)/(U Rate), which shows the improvement of HotTub on the miss rate. Perf cannot report the number of L1-icache loads or memory references to know the corresponding rates. 31 7.3 Speed-up sensitivity to workload differences using the five fastest BigBench queries on Spark with 100GB data. 33 vi List of Figures 3.1 Intercepting mode changing returns. 12 4.1 JVM warm-up time in various HDFS workload. “cl” and “int” represent class loading and inter- pretation time respectively. The x-axis shows the input file size. 15 4.2 The JVM warm-up overhead in HDFS workloads measured as the percentage of overall job com- pletion time. 16 4.3 Breakdown of sequential HDFS read of 1GB file. 16 4.4 Breakdown of the processing of data packets by client and datanode. 17 4.5 JVM overhead on BigBench. Overhead breakdown of BigBench queries across different scale factors. The queries are first grouped by scale factor and then ordered by runtime. Note that Hive has larger query time compared with Spark. 17 4.6 Breakdown of Spark’s execution of query 13. It only shows one executor (there are a total of ten executors, one per host). Each horizontal row represents a thread. The executor uses multiple threads to process this query. Each thread is used to process three tasks from three different stages. 18 5.1 Architecture of HotTub. 22 5.2 HotTub’s client algorithm. 23 7.1 HotTub successfully eliminates warm-up overhead. Unmodified query runtime shown against a breakdown of a query with reuse. There are 10 queries run on 2 scale factors for BigBench on Spark. Interpreter and class loading overhead are so low they are unnoticeable making up the difference. 31 7.2 HotTub iterative runtime improvement. A Sequential 1MB HDFS read performed repeatedly by HotTub. Iteration 0 is the application runtime of a new JVM, while iteration N is the Nth reuse of this JVM. 32 vii Chapter 1 Introduction In recent years it has become increasingly common to use distributed systems to process large amounts of data. A distributed system is a software application that runs on a cluster of computers where the nodes communicate over a network backbone. A major advantage provided by these systems is their ability to process large amounts of data in an economically feasible manner. They can utilize easily accessible and affordable commodity hardware to scale their computation power by continuously adding nodes to the cluster. This is possible as the computation is parallelized across all nodes in the cluster, avoiding the need for strong and expensive individual pieces of hardware. A large number of these data-parallel distributed systems are built on the Java Virtual Machine (JVM) [27]. These systems include distributed file systems such as HDFS [30], data analytic platforms such as Hadoop [29], Spark [67], Tez [65, 79], Hive [34, 80], Impala [13, 39], and key-value stores such as HBase [31] and Cassan- dra [15]. A recent trend is to process latency-sensitive, interactive queries [40, 68, 78] with these systems. For example, interactive query processing is one of the focuses for Spark SQL [10, 67, 68], Hive on Tez [40], and Impala [39]. Numerous improvements have been made to the performance of these systems. These works mostly focused on scheduling [2, 4, 33, 41, 59, 87], shuffling overhead [17, 19, 43, 48, 84], and removing redundant computa- tions [64]. Performance characteristics studies [47, 49, 58, 60] and benchmarks [18, 24, 37, 83] have been used to guide the optimization efforts. Most recently, some studies analyzed the performance implications of the JVM’s garbage collection (GC) on big data systems [26, 51, 52, 62]. However, there lacks an understanding of the JVM’s overall performance implications, other than GC, in latency-sensitive data analytics workloads. Consequently, almost every discussion on the implications of the JVM’s performance results in heated debate [38, 44, 45, 46, 61, 72, 86]. For example, the developers of Hy- 1 CHAPTER 1. INTRODUCTION 2 pertable, an in-memory key-value store, use C++ because they believe that the JVM is inherently slow. They also think that Java is acceptable for Hadoop because “the bulk of the work performed is I/O” [38]. In addition, many believe that as long as the system “scales”, i.e., parallelizes long jobs into short ones, the overhead of the JVM is not concerning [72]. It is clear that given its dynamic nature, the JVM’s overhead heavily depends on the characteristics of the application. For example, whether an interpreted method is compiled to machine instruc- tions by the just-in-time (JIT) compiler depends on how frequently it has been invoked. With all these different perspectives, a clear understanding of the JVM’s performance when running these systems is needed. This research asks a simple question: what is the performance overhead introduced by the JVM in latency- sensitive data-parallel systems? We answer this by presenting a thorough analysis of the JVM’s performance behavior when running systems including HDFS, Hive on Tez, and Spark. We drove our study using representative workloads from recent benchmarks.
Recommended publications
  • D2.1.5 Final Reports on Requirements, Architecture, and Components for Single Trusted Clouds
    D2.1.5 Final Reports on Requirements, Architecture, and Components for Single Trusted Clouds Project number: 257243 Project acronym: TClouds Trustworthy Clouds - Privacy and Re- Project title: silience for Internet-scale Critical Infras- tructure Start date of the project: 1st October, 2010 Duration: 36 months Programme: FP7 IP Deliverable type: Report Deliverable reference number: ICT-257243 / D2.1.5 / 1.0 Activity and Work package contributing Activity 2 / WP 2.1 to deliverable: Due date: September 2013 – M36 Actual submission date: 30th September, 2013 Responsible organisation: SRX Editor: Norbert Schirmer Dissemination level: Public Revision: 1.0 Abstract: cf. Executive Summary Trusted computing, remote attestation, se- cure logging, confidentiality for commodity Keywords: cloud storage, efficient resilience, tailored components D2.1.5 – Final Reports on Requirements, Architecture, and Components for Single Trusted Clouds Editor Norbert Schirmer (SRX) Contributors Johannes Behl, Stefan Brenner, Klaus Stengel (TUBS) Nicola Barresi, Gianluca Ramunno, Roberto Sassu, Paolo Smiraglia (POL) Alexander Büger, Norbert Schirmer (SRX) Tobias Distler, Andreas Ruprecht (FAU) Sören Bleikertz, Zoltan Nagy (IBM) Imad M. Abbadi, Anbang Ruad (OXFD) Sven Bugiel, Hugo Hideler, Stefan Nürnberger (TUDA) Disclaimer This work was partially supported by the European Commission through the FP7-ICT program under project TClouds, number 257243. The information in this document is provided as is, and no warranty is given or implied that the information is fit for
    [Show full text]
  • Android Cours 1 : Introduction `Aandroid / Android Studio
    Android Cours 1 : Introduction `aAndroid / Android Studio Damien MASSON [email protected] http://www.esiee.fr/~massond 21 f´evrier2017 R´ef´erences https://developer.android.com (Incontournable !) https://openclassrooms.com/courses/ creez-des-applications-pour-android/ Un tutoriel en fran¸caisassez complet et plut^ot`ajour... 2/52 Qu'est-ce qu'Android ? PME am´ericaine,Android Incorporated, cr´e´eeen 2003, rachet´eepar Google en 2005 OS lanc´een 2007 En 2015, Android est le syst`emed'exploitation mobile le plus utilis´edans le monde (>80%) 3/52 Qu'est-ce qu'Android ? Cinq couches distinctes : 1 le noyau Linux avec les pilotes ; 2 des biblioth`equeslogicielles telles que WebKit/Blink, OpenGL ES, SQLite ou FreeType ; 3 un environnement d'ex´ecutionet des biblioth`equespermettant d'ex´ecuterdes programmes pr´evuspour la plate-forme Java ; 4 un framework { kit de d´eveloppement d'applications ; 4/52 Android et la plateforme Java Jusqu'`asa version 4.4, Android comporte une machine virtuelle nomm´eeDalvik Le bytecode de Dalvik est diff´erentde celui de la machine virtuelle Java de Oracle (JVM) le processus de construction d'une application est diff´erent Code Java (.java) ! bytecode Java (.class/.jar) ! bytecode Dalvik (.dex) ! interpr´et´e L'ensemble de la biblioth`equestandard d'Android ressemble `a J2SE (Java Standard Edition) de la plateforme Java. La principale diff´erenceest que les biblioth`equesd'interface graphique AWT et Swing sont remplac´eespar des biblioth`equesd'Android. 5/52 Android Runtime (ART) A` partir de la version 5.0 (2014), l'environnement d'ex´ecution ART (Android RunTime) remplace la machine virtuelle Dalvik.
    [Show full text]
  • Code Coagulation Is an Effective Compilation Technique
    CODE COAGULATION IS AN EFFECTIVE COMPILATION TECHNIQUE FOR THE JVM by Shruthi Padmanabhan Bachelor of Engineering in Information Science, Visvesvaraya Technological University, 2009 A thesis presented to Ryerson University in partial fulfillment of the requirements for the degree of Master of Science in the program of Computer Science Toronto, Ontario, Canada, 2018 c Shruthi Padmanabhan, 2018 Author's Declaration I hereby declare that I am the sole author of this thesis. This is a true copy of the thesis, including any required final revisions, as accepted by my examiners. I authorize Ryerson University to lend this thesis to other institutions or individuals for the purpose of scholarly research. I further authorize Ryerson University to reproduce this thesis by photocopying or by other means, in total or in part, at the request of other institutions or individuals for the purpose of scholarly research. I understand that my thesis may be made electronically available to the public for the purpose of scholarly research only. ii Abstract CODE COAGULATION IS AN EFFECTIVE COMPILATION TECHNIQUE FOR THE JVM Shruthi Padmanabhan Master of Science, Computer Science Ryerson University, 2018 Compilers are the interface between programmers and computers. The output of a com- piler determines the speed of the resulting program as well as its energy footprint { of increasing importance in this world of climate change and battery-dependent computing. Code coagulation has the potential to improve that performance, particularly relative to (JIT) interpreters. Java and related languages are in wide use, so addressing their per- formance has large potential impact. Optijava is an experimental compiler that applies code coagulation to Java programs.
    [Show full text]
  • Master En Modelización Matemática, Estadística Y Computación 2011-2012
    MASTER EN MODELIZACIÓN MATEMÁTICA, ESTADÍSTICA Y COMPUTACIÓN 2011-2012 Curso: Bases de datos y programación orientada a objetos Parte POO [email protected] http://gtts.ehu.es/German MASTER EN MODELIZACIÓN MATEMÁTICA, ESTADÍSTICA Y COMPUTACIÓN 2011-2012 Curso: Bases de datos y programación orientada a objetos Parte POO PREMISAS 1) Es esencial asimilar lo que son clases y objetos 2) Se utilizará JAVA. Aprenderemos el núcleo del lenguaje y cómo ser autosuficientes con las librerías. 3) Nos centraremos en las capacidades de E/S y en la conexión a bases de datos. 4) Se presentará una aplicación web que acceda a la base de datos de MySQL. [email protected] http://gtts.ehu.es/German Bases de datos y Java * Java y bases de datos 1. Java necesita un modelo de persistencia para tener éxito real. 2. Larga historia de Sun con bases de datos poco exitosas. 3. Dos bases de datos dominan: Oracle (comercial) y MySQL (libre). 4. Sun compra MySQL (enero 2008). 5. Oracle compra SUN (abril 2009) (ver dimensiones SUN /ORACLE). * La importancia de las bases de datos en la economía mundial [email protected] http://gtts.ehu.es/German 18:1 SUN ocupa el puesto 186 [email protected] http://gtts.ehu.es/German Bases de datos y Java [email protected] http://gtts.ehu.es/German [email protected] http://gtts.ehu.es/German Antes de nada… la máquina virtual Proprietary/closed source implementations "Write Once, Run Anywhere" * Hewlett-Packard's Java for HP-UX, OpenVMS, Tru64 and Reliant (Tandem) UNIX platforms * J9 VM from IBM, for AIX, Linux, MVS, OS/400, Pocket PC, z/OS * Mac OS Runtime for Java (MRJ) from Apple Inc.
    [Show full text]
  • Java Magazine, November/December 2017
    DYNAMIC METHOD INVOCATION 67 | INSIDE JAVA CARD 77 | JAVA QUIZ 91 NOVEMBER/DECEMBER 2017 magazine By and for the Java community JAVA EE 8 WHAT YOU NEED TO KNOW 13 23 43 56 SERVLET 4.0 CDI 2.0 JPA 2.2 MICROPROFILE ORACLE.COM/JAVAMAGAZINE //table of contents / COVER FEATURES 23 43 56 CDI 2.0: MAKING WHAT’S NEW IN JPA 2.2 ECLIPSE MICROPROFILE: DEPENDENCY INJECTION By Josh Juneau THE LIGHT ENTERPRISE A LOT EASIER Streaming results, better date JAVA OPTION By Arjan Tijms conversions, and new annotations By Mert Çalişkan A new spec, new features, are just a few of the many handy Examining a Java EE architecture 13 and new annotations. What’s improvements. designed for microservices and SERVLET 4.0: DOING MORE FASTER not to like? distributed applications By Alex Theedom A major new release of the Servlet API embraces the HTTP/2 protocol and anticipates resource requirements. OTHER FEATURES DEPARTMENTS 67 91 05 11 Understanding Java Method Fix This From the Editor Java Proposals of Interest Invocation with Invokedynamic By Simon Roberts Java EE 8 development goes JEP 295: Ahead-of-Time Compilation By Ben Evans Our latest quiz with questions that test open source. to Native Binaries The instruction added in Java 7 makes intermediate and advanced knowledge 07 42 it possible to resolve method calls dynam- of the language ically at runtime. Java Books User Groups Review of Ken Kousen’s Modern The Netherlands JUG 77 Java Recipes 101 An Introduction to Java Card 09 By Nicolas Ponsini and Florian Tournier Contact Us The smallest Java platform is one of the Events Have a comment? Suggestion? Want to most widely distributed.
    [Show full text]
  • Spring Integration | Java Dsl Цфт Ты Вообще Кто?
    Владимир Плизгá SPRING INTEGRATION | JAVA DSL ЦФТ ТЫ ВООБЩЕ КТО? .Владимир Плизгá .Backend разработчик Позиция: главный инженер-программист, ЦФТ (Центр Финансовых Технологий) Область: разработка Интернет-банков и https://oplata.kykyryza.ru сопутствующих сервисов .Опыт в области: 6+ лет • 20+ партнёров по Интернет-банкам • 20+ партнёров по сайтам подарочных карт 2 ЧТО ТАКОЕ SPRING INTEGRATION? .Проект в экосистеме Spring * IoC – Inversion of Control * EIP – Enterprise Integration Patterns 3 ВКРАТЦЕ О EIP .Высокоуровневая программная модель для построения интеграций .Как внутри приложения .Так и между приложениями .65 паттернов на все случаи жизни .Обеспечивает слабую связность компонентов .Не зависит от стека технологий 4 КОНЦЕПЦИИ EIP: MESSAGE & CHANNEL Сообщение Канал public interface Message<T> { @FunctionalInterface T getPayload(); public interface MessageChannel { MessageHeaders getHeaders(); boolean send(Message<?> message); } } 5 КОНЦЕПЦИИ EIP: ENDPOINT . Transform . Filter . Handle . Split . Aggregate . Route . Bridge . … 6 КОНЦЕПЦИИ EIP: ADAPTER .AMQP/JMS .JBDC/JPA/NoSQL .File .Mail .Social .FTP[S]/SFTP .HTTP/WebFlux/WebSocket .RMI .… 7 ПРИЧЁМ ТУТ SPRING INTEGRATION? «Спецификация» «Имплементация» JVMS HotSpot, JRockit, Excelsior JET JPA Hibernate AMQP RabbitMQ, ActiveMQ EIP Apache Camel, Spring Integration Набор реализующих EIP компонентов, позволяющих разработчику концентрироваться на бизнес-логике и минимально заниматься инфраструктурой обмена сообщениями 8 КАК РАБОТАЕТ SPRING INTEGRATION .Комбинация каналов и точек обработки
    [Show full text]
  • X9ware-Installation-Guide
    X9Ware Installation Guide X9Ware LLC X9Ware Installation Guide X9Assist: Your x9.37 support tool Revision Date: 06/18/2021 Copyright 2012 – 2018 X9Ware LLC All enclosed information is proprietary to X9Ware LLC X9Ware LLC 10 Windsor Lane Manchester MO 63011 Email: s ales @ x9ware.com Page 1 of 95 X9Ware Installation Guide X9Ware LLC Table of Contents Overview...................................................................................................................................................4 Installing X9Assist and X9Utilities.........................................................................................................10 X9Assist Installation Packages...........................................................................................................10 X9Utilities Installation Packages........................................................................................................10 Installation Overview..........................................................................................................................11 Installation Notes................................................................................................................................11 X9Assist Installation on macOS.........................................................................................................12 X9Assist Automated File Copies........................................................................................................13 MSI Packages and Silent Operations..................................................................................................14
    [Show full text]
  • Java Virtual Machine
    International Journal of Advanced Technology in Engineering and Science www.ijates.com Volume No.02, Special Issue No. 01, September 2014 ISSN (online): 2348 – 7550 JAVA VIRTUAL MACHINE Manjeet Saini1, Abhishek Jain2, Ashish Chauhan3 1, 2, 3Department Of Computer Science And Engineering, Dronacharya College Of Engineering Khentawas, Farrukh Nagar, Gurgaon, Haryana ABSTRACT This machine or the „Simulated computer within the computer‟ is known as the “Java Virtual Machine” or JVM. It is an abstract machine. It is a specification that provides runtime environment in which java byte code can be executed. JVM loads, verifies and executes the code. It provides a runtime environment. It provides definitions for the Memory area, Class file format, Register set, Garbage-collected heap, fatal error reporting etc. The Java Virtual Machine forms part of a large system, the Java Runtime Environment (JRE). Each operating system and CPU architecture requires a different JRE. Keywords: Just-In-Time, Interpreter, Compiler, Ahead Of Time Compilation, Transpiler, Cross Compiler, De-Compiler, Low Level Language, Assembly Language, High Level Language, Object Code, Translator. I. INTRODUCTION Java virtual machine is a virtual machine which is used to execute the java byte code files. It is the code execution component of java development kit. A Java virtual machine (JVM) works as an interpreter. It interprets compiled java byte code also known as java binary code for computer processor or hardware platform so that it can perform java program’s instruction. James Gosling introduces JVM concept to make java platform independent language. Java allows programmers to write code that could run on any platform without the need for rewriting and recompilation for each separate platform.
    [Show full text]
  • The September/October 2016 Issue of Java Magazine
    JAX-RS 39 | JAVA INTERFACES 47 | FANTOM 53 SEPTEMBER/OCTOBER 2016 magazine By and for the Java community Devices and IoT INTERACTING 14 WITH SENSORS CONTROLLING CNC ROUTING 24 FROM A RASPBERRY PI IOT AND 32 THE CLOUD ORACLE.COM/JAVAMAGAZINE //table of contents / 14 24 32 RASPBERRY PI– USING THE CLOUD INTERACTING WITH SENSORS CONTROLLED CNC WITH IOT ROUTER By Eric Bruno ON INTEL’S X86 GALILEO BOARD By Stephen Chin By pushing device control and Programming the Raspberry Pi analytics into an IoT-specific to manage cutting, carving, cloud, devices can be remotely and routing operations managed and operated. By Gastón Hillar Capturing and responding to data are the heart and soul of IoT. Here’s how to do both with Java on an inexpensive board that uses an x86 processor. COVER ART BY I-HUA CHEN 04 11 47 58 From the Editor JVM Language Summit 2016 New to Java Fix This Appreciating Limited Choice in Recapping a small annual conference The Evolving Nature of Interfaces By Simon Roberts Languages: The more prescriptive that dives deeply into the JVM By Michael Kölling Our latest code quiz a language is in the details, the 12 Understanding multiple inheritance and 23 easier it is to code productively. Java Books the role of Java 8’s default methods Java Proposals of Interest 06 Review of Java Performance Companion 53 JEP 293: Revising the format Letters to the Editor 39 JVM Languages of command-line options Comments, questions, suggestions, Enterprise Java Fantom Programming Language 64 and kudos By Brian Frank User Groups JAX-RS.next: A First Glance A language that runs on the JVM and 09 By Sebastian Daschner Danish JUG JavaScript VMs and delivers excellent Events A look at what’s coming next in UI-building capabilities 65 Upcoming Java conferences and events JAX-RS 2.1 Contact Us Have a comment? Suggestion? Want to submit an article proposal? Here’s how.
    [Show full text]
  • Efficient Compilation of .NET Programs for Embedded Systems
    Journal of Object Technology Published by AITO — Association Internationale pour les Technologies Objets, c JOT 2011 Online at http://www.jot.fm. Efficient Compilation of .NET Programs for Embedded Systems Olivier Sallenaveab Roland Ducournaub a. Cortus S.A., Montpellier, France http://www.cortus.com b. LIRMM — CNRS and Université Montpellier 2, France http://www.lirmm.fr Abstract Compiling under the closed-world assumption (CWA) has been shown to be an appropriate way for implementing object-oriented lan- guages such as Java on low-end embedded systems. In this paper, we ex- plore the implications of using whole program optimizations such as Rapid Type Analysis (RTA) and coloring on programs targeting the .Net infras- tructure. We extended RTA so that it takes into account .Net specific features such as (i) array covariance, a language feature also supported in Java, (ii) generics, whose specifications in .Net impacts type analysis and (iii) delegates, which encapsulate methods within objects. We also use an intraprocedural control flow analysis in addition to RTA . We eval- uated the optimizations that we implemented on programs written in C#. Preliminary results show a noticeable reduction of the code size, class hi- erarchy and polymorphism of the programs we optimize. Array covariance is safe in almost all cases, and some delegate calls can be implemented as direct calls. Keywords array covariance, closed-world assumption, delegate, late bind- ing, subtype test, type analysis 1 Introduction High-end embedded systems such as mobile phones have widely adopted object- oriented languages like Java. Object-oriented programming offers code reuse through inheritance and more reliable designs, which improves the productivity in software development.
    [Show full text]
  • Effective Enhancement of Loop Versioning in Java
    Effective Enhancement of Loop Versioning in Java Vitaly V. Mikheev, Stanislav A. Fedoseev, Vladimir V. Sukharev, and Nikita V. Lipsky A. P. Ershov Institute of Informatics Systems, Excelsior, LLC Novosibirsk, Russia {vmikheev,sfedoseev,vsukharev,nlipsky}@excelsior-usa.com Abstract. Run-time exception checking is required by the Java Lan- guage Specification (JLS). Though providing higher software reliability, that mechanism negatively affects performance of Java programs, es- pecially those computationally intensive. This paper pursues loop ver- sioning, a simple program transformation which often helps to avoid the checking overhead. Basing upon the Java Memory Model precisely defined in JLS, the work proposes a set of sufficient conditions for appli- cability of loopversioning. Scalable intra- and interprocedural analyses that efficiently check fulfilment of the conditions are also described. Im- plemented in Excelsior JET, an ahead-of-time compiler for Java, the developed technique results in significant performance improvements on some computational benchmarks. Keywords: Java, performance, loop optimizations, ahead-of-time com- pilation 1 Introduction To date, Java has become an industry-standard programming language. As Java bytecode [3] is a (portable) form of intermediate representation, a great wealth of dynamic and static optimization techniques was proposed to improve the originally poor performance of Java applications. One of the reasons for the in- sufficient performance is obligatory run-time checks for array elements access op- erations. JLS [2] requires two checks1 for read/write of each array element a[i]: first, a has not to be null (otherwise NullPointerException should be thrown), then i must be in the range 0<=i<a.length (if not, IndexOutOfBoundException should be thrown).
    [Show full text]
  • Real-Time Code Generation in Virtualizing Runtime Environments
    Department of Computer Science Real-time Code Generation in Virtualizing Runtime Environments Dissertation submitted in fulfillment of the requirements for the academic degree doctor of engineering (Dr.-Ing.) to the Department of Computer Science of the Chemnitz University of Technology from: Dipl.-Inf. (Univ.) Martin Däumler born on: 03.01.1985 born in: Plauen Assessors: Prof. Dr.-Ing. habil. Matthias Werner Prof. Dr. rer. nat. habil. Wolfram Hardt Chemnitz, March 3, 2015 Acknowledgements The work on this research topic was a professional and personal development, rather than just writing this thesis. I would like to thank my doctoral adviser Prof. Dr. Matthias Werner for the excellent supervision and the time spent on numerous professional discus- sions. He taught me the art of academia and research. I would like to thank Alexej Schepeljanski for the time spent on discussions, his advices on technical problems and the very good working climate. I also thank Prof. Dr. Wolfram Hardt for the feedback and the cooperation. I am deeply grateful to my family and my girlfriend for the trust, patience and support they gave to me. Abstract Modern general purpose programming languages like Java or C# provide a rich feature set and a higher degree of abstraction than conventional real-time programming languages like C/C++ or Ada. Applications developed with these modern languages are typically deployed via platform independent intermediate code. The intermediate code is typi- cally executed by a virtualizing runtime environment. This allows for a high portability. Prominent examples are the Dalvik Virtual Machine of the Android operating system, the Java Virtual Machine as well as Microsoft .NET’s Common Language Runtime.
    [Show full text]