Cargando…
An Empirical Study on the Use and Misuse of Java 8 Streams
Streaming APIs allow for big data processing of native data structures by providing MapReduce-like operations over these structures. However, unlike traditional big data systems, these data structures typically reside in shared memory accessed by multiple cores. Although popular, this emerging hybri...
Autores principales: | , , , |
---|---|
Formato: | Online Artículo Texto |
Lenguaje: | English |
Publicado: |
2020
|
Materias: | |
Acceso en línea: | https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7418129/ http://dx.doi.org/10.1007/978-3-030-45234-6_5 |
_version_ | 1783569631714213888 |
---|---|
author | Khatchadourian, Raffi Tang, Yiming Bagherzadeh, Mehdi Ray, Baishakhi |
author_facet | Khatchadourian, Raffi Tang, Yiming Bagherzadeh, Mehdi Ray, Baishakhi |
author_sort | Khatchadourian, Raffi |
collection | PubMed |
description | Streaming APIs allow for big data processing of native data structures by providing MapReduce-like operations over these structures. However, unlike traditional big data systems, these data structures typically reside in shared memory accessed by multiple cores. Although popular, this emerging hybrid paradigm opens the door to possibly detrimental behavior, such as thread contention and bugs related to non-execution and non-determinism. This study explores the use and misuse of a popular streaming API, namely, Java 8 Streams. The focus is on how developers decide whether or not to run these operations sequentially or in parallel and bugs both specific and tangential to this paradigm. Our study involved analyzing 34 Java projects and 5:53 million lines of code, along with 719 manually examined code patches. Various automated, including interprocedural static analysis, and manual methodologies were employed. The results indicate that streams are pervasive, parallelization is not widely used, and performance is a crosscutting concern that accounted for the majority of fixes. We also present coincidences that both confirm and contradict the results of related studies. The study advances our understanding of streams, as well as benefits practitioners, programming language and API designers, tool developers, and educators alike. |
format | Online Article Text |
id | pubmed-7418129 |
institution | National Center for Biotechnology Information |
language | English |
publishDate | 2020 |
record_format | MEDLINE/PubMed |
spelling | pubmed-74181292020-08-11 An Empirical Study on the Use and Misuse of Java 8 Streams Khatchadourian, Raffi Tang, Yiming Bagherzadeh, Mehdi Ray, Baishakhi Fundamental Approaches to Software Engineering Article Streaming APIs allow for big data processing of native data structures by providing MapReduce-like operations over these structures. However, unlike traditional big data systems, these data structures typically reside in shared memory accessed by multiple cores. Although popular, this emerging hybrid paradigm opens the door to possibly detrimental behavior, such as thread contention and bugs related to non-execution and non-determinism. This study explores the use and misuse of a popular streaming API, namely, Java 8 Streams. The focus is on how developers decide whether or not to run these operations sequentially or in parallel and bugs both specific and tangential to this paradigm. Our study involved analyzing 34 Java projects and 5:53 million lines of code, along with 719 manually examined code patches. Various automated, including interprocedural static analysis, and manual methodologies were employed. The results indicate that streams are pervasive, parallelization is not widely used, and performance is a crosscutting concern that accounted for the majority of fixes. We also present coincidences that both confirm and contradict the results of related studies. The study advances our understanding of streams, as well as benefits practitioners, programming language and API designers, tool developers, and educators alike. 2020-03-13 /pmc/articles/PMC7418129/ http://dx.doi.org/10.1007/978-3-030-45234-6_5 Text en © The Author(s) 2020 Open Access This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made. The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. |
spellingShingle | Article Khatchadourian, Raffi Tang, Yiming Bagherzadeh, Mehdi Ray, Baishakhi An Empirical Study on the Use and Misuse of Java 8 Streams |
title | An Empirical Study on the Use and Misuse of Java 8 Streams |
title_full | An Empirical Study on the Use and Misuse of Java 8 Streams |
title_fullStr | An Empirical Study on the Use and Misuse of Java 8 Streams |
title_full_unstemmed | An Empirical Study on the Use and Misuse of Java 8 Streams |
title_short | An Empirical Study on the Use and Misuse of Java 8 Streams |
title_sort | empirical study on the use and misuse of java 8 streams |
topic | Article |
url | https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7418129/ http://dx.doi.org/10.1007/978-3-030-45234-6_5 |
work_keys_str_mv | AT khatchadourianraffi anempiricalstudyontheuseandmisuseofjava8streams AT tangyiming anempiricalstudyontheuseandmisuseofjava8streams AT bagherzadehmehdi anempiricalstudyontheuseandmisuseofjava8streams AT raybaishakhi anempiricalstudyontheuseandmisuseofjava8streams AT khatchadourianraffi empiricalstudyontheuseandmisuseofjava8streams AT tangyiming empiricalstudyontheuseandmisuseofjava8streams AT bagherzadehmehdi empiricalstudyontheuseandmisuseofjava8streams AT raybaishakhi empiricalstudyontheuseandmisuseofjava8streams |