{"title":"Ohua: Implicit Dataflow Programming for Concurrent Systems","authors":"Sebastian Ertel, C. Fetzer, P. Felber","doi":"10.1145/2807426.2807431","DOIUrl":"https://doi.org/10.1145/2807426.2807431","url":null,"abstract":"Concurrent programming has always been a challenging task best left to expert developers. Yet, with the advent of multi-core systems, programs have to explicitly deal with multithreading to fully exploit the parallel processing capabilities of the underlying hardware. There has been much research over the last decade on abstractions to develop concurrent code that is both safe and efficient, e.g., using message passing, transactional memory, or event-based programming. In this paper, we focus on the dataflow approach as a way to design scalable concurrent applications. We propose a new dataflow engine and programming framework, named Ohua, that supports implicit parallelism. Ohua marries object-oriented and functional languages: functionality developed in Java can be composed with algorithms in Clojure. This allows us to use different programming styles for the tasks each language is best adapted for. The actual dataflow graphs are automatically derived from the Clojure code. We show that Ohua is not only powerful and easy to use for the programmer, but also produces applications that scale remarkably well: comparative evaluation indicates that a simple web server developed with Ohua outperforms the highly-optimized Jetty server in terms of throughput while being competitive in terms of latency. We also evaluate the impact on energy consumption to validate previous studies indicating that dataflow and message passing can be more energy-efficient than concurrency control based on shared-memory synchronization.","PeriodicalId":104024,"journal":{"name":"Proceedings of the Principles and Practices of Programming on The Java Platform","volume":"50 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2015-09-08","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"129271735","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Vlad Ureche, Miloš Stojanović, Romain Béguet, Nicolas Stucki, Martin Odersky
{"title":"Improving the Interoperation between Generics Translations","authors":"Vlad Ureche, Miloš Stojanović, Romain Béguet, Nicolas Stucki, Martin Odersky","doi":"10.1145/2807426.2807436","DOIUrl":"https://doi.org/10.1145/2807426.2807436","url":null,"abstract":"Generics on the Java platform are compiled using the erasure transformation, which only supports by-reference values. This causes slowdowns when generics operate on primitive types, such as integers, as they have to be transformed into reference-based objects. Project Valhalla is an effort to remedy this problem by specializing classes at load-time so they can efficiently handle primitive values. In its current early prototype, the Valhalla compilation scheme limits the interaction between specialized and erased generics, thus preventing certain useful code patterns from being expressed. Scala has been using compile-time specialization for 6 years and has three generics compilation schemes working side by side. In Scala, programmers are allowed to write code that freely exercises the interaction between the different compilation schemes, at the expense of introducing subtle performance issues. Similar performance issues can affect Valhalla-enabled bytecode, whether the code was written in Java or translated from other JVM languages. In this context we explain how we help programmers avoid these performance regressions in the miniboxing transformation: (1) by issuing actionable performance advisories that steer programmers away from performance regressions and (2) by providing alternatives to the standard library constructs that use the miniboxing encoding, thus avoiding the conversion overhead.","PeriodicalId":104024,"journal":{"name":"Proceedings of the Principles and Practices of Programming on The Java Platform","volume":"22 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2015-09-08","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"116044838","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"Mining Method Handle Graphs for Efficient Dynamic JVM Languages","authors":"Shijie Xu, David Bremner, Daniel Heidinga","doi":"10.1145/2807426.2807440","DOIUrl":"https://doi.org/10.1145/2807426.2807440","url":null,"abstract":"The Java Virtual Machine (JVM) has been used as an execution platform by many dynamically-typed programming languages such as Ruby, Python, and Groovy. The main challenge to compile such dynamic JVM languages is choosing the most appropriate implementation of a method for various types of an object at runtime. To address this challenge, a new Java bytecode instruction, invokedynamic, has been introduced, allowing users to control the linkage between a call site and a method implementation. With this instruction, a method handle that refers to a method is linked to the call site and then potentially transforms the invocation to a real implementation. As a referenced method of a method handle might in turn refer to other method handles, multiple method handles constitute a Method Handle Graph (MHG). In order to support more efficient dynamic JVM language implementations, we present methods to mine patterns in the method handle graph. We investigate two kinds of method handle patterns: the transformation pattern and the instance pattern. The transformation pattern refers to a composition of multiple method handle transformations, and the instance pattern refers to equivalent method handles in MHGs. Both patterns are mined by the presented suffix tree and equivalency detector, respectively, which are implemented as modules in the Method Handle Mining System (MHMS). Our experiments on the JRuby Micro-Indy benchmark reveal several findings: a) the frequency of different transformation patterns varies significantly, and the JRuby interpreter prefers a small number of transformation patterns, b) a large proportion of method handles, 28.83%, are equivalent, and most of these equivalent method handles can be eliminated to reduce consumed memory, and c) the distribution of equivalent sets for length-two method handle chains is also uneven. For example, only 7% of these sets have more than 30 equivalent method handle chains. We believe these insights are important steps towards further optimizations based on method handle graphs.","PeriodicalId":104024,"journal":{"name":"Proceedings of the Principles and Practices of Programming on The Java Platform","volume":"5 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2015-09-08","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"124929489","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Aritra Sengupta, Man Cao, Michael D. Bond, Milind Kulkarni
{"title":"Toward Efficient Strong Memory Model Support for the Java Platform via Hybrid Synchronization","authors":"Aritra Sengupta, Man Cao, Michael D. Bond, Milind Kulkarni","doi":"10.1145/2807426.2807432","DOIUrl":"https://doi.org/10.1145/2807426.2807432","url":null,"abstract":"The Java memory model provides strong behavior guarantees for data-race-free executions. However, it provides very weak guarantees for racy executions, leading to unexpected, unintuitive behaviors. This paper focuses on how to provide a memory model, called statically bounded region serializability (SBRS), that is substantially stronger than the Java memory model. Our prior work introduces SBRS, as well as compiler and runtime support for enforcing SBRS called EnfoRSer. EnfoRSer modifies the dynamic compiler to insert instrumentation to acquire a lock on each object accessed by the program. For most programs, EnfoRSer's primary run-time cost is executing this instrumentation at essentially every memory access. This paper focuses on reducing the run-time overhead of enforcing SBRS by avoiding instrumentation at every memory access that acquires a per-object lock. We experiment with an alternative approach for providing SBRS that instead acquires a single static lock before each executed region; all regions that potentially race with each other---according to a sound whole-program static analysis--- must acquire the same lock. This approach slows most programs dramatically by needlessly serializing regions that do not actually conflict with each other. We thus introduce a hybrid approach that judiciously combines the two locking strategies, using a cost model and run-time profiling. Our implementation and evaluation in a Java virtual machine use offline profiling and recompilation, thus demonstrating the potential of the approach without incurring online profiling costs. The results show that although the overall performance benefit is modest, our hybrid approach never significantly worsens performance, and for two programs, it significantly outperforms both approaches that each use only one kind of locking. These results demonstrate the potential of a technique based on combining synchronization mechanisms to provide a strong end-to-end memory model for Java and other JVM languages.","PeriodicalId":104024,"journal":{"name":"Proceedings of the Principles and Practices of Programming on The Java Platform","volume":"1 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2015-09-08","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"115704412","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Gülfem Savrun-Yeniçeri, M. L. V. D. Vanter, Per Larsen, Stefan Brunthaler, M. Franz
{"title":"An Efficient and Generic Event-based Profiler Framework for Dynamic Languages","authors":"Gülfem Savrun-Yeniçeri, M. L. V. D. Vanter, Per Larsen, Stefan Brunthaler, M. Franz","doi":"10.1145/2807426.2807435","DOIUrl":"https://doi.org/10.1145/2807426.2807435","url":null,"abstract":"Profilers help programmers analyze their programs and identify performance bottlenecks. We implement a profiler framework that helps to compare and analyze programs implementing the same algorithms written in different languages. Profiler implementers replicate common functionalities in their language profilers. We focus on building a generic profiler framework for dynamic languages to minimize the recurring implementation effort. We implement our profiler in a framework that optimizes abstract syntax tree (AST) interpreters using a just-in-time (JIT) compiler. We evaluate it on ZipPy and JRuby+Truffle, Python and Ruby implementations in this framework, respectively. We show that our profiler runs faster than the existing profilers in these languages and requires modest implementation effort. Our profiler serves three purposes: 1) helps users to find the bottlenecks in their programs, 2) helps language implementers to improve the performance of their language implementation, 3) helps to compare and evaluate different languages on cross-language benchmarks.","PeriodicalId":104024,"journal":{"name":"Proceedings of the Principles and Practices of Programming on The Java Platform","volume":"10 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2015-09-08","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"123671135","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"On-Line Synchronous Total Purely Functional Data-Flow Programming on the Java Virtual Machine with Sig","authors":"B. T. Widemann, M. Lepper","doi":"10.1145/2807426.2807430","DOIUrl":"https://doi.org/10.1145/2807426.2807430","url":null,"abstract":"Sig is the prototype of a purely declarative programming language and system for the processing of discrete, clocked synchronous, potentially real-time data streams. It aspires to combine good static safety, scalability and platform independence, with semantics that are precise, concise and suitable for domain experts. Its semantical and operational core has been formalized. Here we discuss the general strategy for making Sig programs executable, and describe the current state of a prototype compiler. The compiler is implemented in Java and targets the JVM. By careful cooperation with the JVM just-in-time compiler, it provides immediate executability in a simple and quickly extensible runtime environment, with code performance suitable for moderate real-time applications such as interactive audio synthesis.","PeriodicalId":104024,"journal":{"name":"Proceedings of the Principles and Practices of Programming on The Java Platform","volume":"3 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2015-09-08","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"122901278","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"Efficient Rebuilding of Large Java Heaps from Event Traces","authors":"Verena Bitto, Philipp Lengauer, H. Mössenböck","doi":"10.1145/2807426.2807433","DOIUrl":"https://doi.org/10.1145/2807426.2807433","url":null,"abstract":"Understanding and tracking down memory-related performance problems, such as long garbage collection times and memory leaks, is a tedious task in large and complex applications. Memory profilers can support developers in this task by recording detailed traces of the application's memory behavior which can then be analyzed offline. Unfortunately, these traces can become huge, and processing them is a real challenge. If the goal is to rebuild the heap from a trace in order to analyze it, most state-of-the-art tools perform badly, because they are either too slow or provide only a coarse-grained view of the monitored application. In this paper we present novel techniques and data structures for efficiently processing large event traces and for reconstructing the heap with only a fraction of the monitored application's memory. The reconstructed heap contains vital information about all objects, such as their addresses, their types, their allocation sites, and their allocating threads. We also provide a detailed evaluation of our approach on 33 benchmarks, showing that we can rebuild the heap from a trace efficiently using only about 18% of the memory that was used in the monitored application.","PeriodicalId":104024,"journal":{"name":"Proceedings of the Principles and Practices of Programming on The Java Platform","volume":"64 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2015-09-08","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"125894114","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}