Academic Journal
Safe automated refactoring for intelligent parallelization of Java 8 streams
| Τίτλος: | Safe automated refactoring for intelligent parallelization of Java 8 streams |
|---|---|
| Συγγραφείς: | Raffi Khatchadourian, Yiming Tang, Mehdi Bagherzadeh |
| Στοιχεία εκδότη: | Zenodo |
| Έτος έκδοσης: | 2020 |
| Συλλογή: | Zenodo |
| Θεματικοί όροι: | Automated refactoring, Automatic parallelization, Typestate analysis, Java 8, Streams |
| Περιγραφή: | Streaming APIs are becoming more pervasive in mainstream Object-Oriented programming languages and platforms. For example, the Stream API introduced in Java 8 allows for functional-like, MapReduce-style operations in processing both finite, e.g., collections, and infinite data structures. However, using this API efficiently involves subtle considerations such as determining when it is best for stream operations to run in parallel, when running operations in parallel can be less efficient, and when it is safe to run in parallel due to possible lambda expression side-effects. In this paper, we present an automated refactoring approach that assists developers in writing efficient stream code in a semantics-preserving fashion. The approach, based on a novel data ordering and typestate analysis, consists of preconditions and transformations for automatically determining when it is safe and possibly advantageous to convert sequential streams to parallel and unorder or de-parallelize already parallel streams. The approach was implemented as a plug-in to the popular Eclipse IDE, uses the WALA and SAFE analysis frameworks, and was evaluated on 18 Java projects consisting of ~1.65M lines of code. We found that 116 of 419 candidate streams (27.68%) were refactorable, and an average speedup of 3.49 on performance tests was observed. The results indicate that the approach is useful in optimizing stream code to their full potential. ; Support for this project was provided by PSC-CUNY Award #61793-00 49, jointly funded by The Professional Staff Congress and The City University of New York. Bagherzadeh was supported by Oakland University. |
| Τύπος εγγράφου: | article in journal/newspaper |
| Γλώσσα: | unknown |
| Relation: | https://khatchad.commons.gc.cuny.edu/wp-content/blogs.dir/2880/files/2020/05/techreport-544.pdf; https://zenodo.org/records/3818470; oai:zenodo.org:3818470; https://doi.org/10.5281/zenodo.3818470 |
| DOI: | 10.5281/zenodo.3818470 |
| Διαθεσιμότητα: | https://doi.org/10.5281/zenodo.3818470 https://zenodo.org/records/3818470 |
| Rights: | Creative Commons Attribution 4.0 International ; cc-by-4.0 ; https://creativecommons.org/licenses/by/4.0/legalcode |
| Αριθμός Καταχώρησης: | edsbas.1D93A7A1 |
| Βάση Δεδομένων: | BASE |
| DOI: | 10.5281/zenodo.3818470 |
|---|