The Java Stream API aims at increasing developer productivity thanks to an easy-to-read declarative syntax to express computations. It also simplifies parallel computing, providing a high-level abstraction on top of common parallelization aspects. Unfortunately, there is a lack of benchmarks specifically targeting stream-based applications. Such a lack of benchmarks makes it difficult for researchers and developers of the Java class library to optimize the Stream API. Moreover, in the absence of dedicated benchmarks, it is difficult to analyze the performance of streams to suggest developers how to write efficient code using the API. In this work we present JEDI, a benchmark suite that targets the Stream API. JEDI is automatically generated by converting SQL benchmarks into Java benchmarks. Our code generator supports targets different implementations (both stream-based and imperative) for the same query. The ultimate goal of our benchmark suite -- and the main contribution of this work -- is to analyze the performance of the different implementations to spot inefficient code structures and better alternatives, suggesting best practices to Java developers. Among the multiple implementations we generate, we focus on different parallelization strategies and explain the most efficient parallelization strategies based on characteristics of the processed data. Finally, the code generation producing imperative code defines of a baseline that can guide researchers and Java implementers to optimize the Stream API.


翻译:摘要:Java Stream API 旨在通过易读的声明式语法表达计算,从而提高开发效率。它通过提供高层次抽象简化并行计算,隐藏了常见的并行化细节。然而,目前缺乏专门针对流式应用的基准测试。这种基准测试的缺失使得Java类库的研究者和开发者难以优化Stream API。此外,在没有专用基准测试的情况下,分析流的性能并为开发者提供如何使用该API编写高效代码的指导也面临困难。本文提出了JEDI——一个针对Stream API的基准测试集。JEDI通过将SQL基准测试自动转换为Java基准测试生成。我们的代码生成器支持为同一查询生成不同的实现(包括基于流的和命令式的)。该基准测试集的最终目标——也是本研究的主要贡献——是分析不同实现的性能,以识别低效代码结构及其更优替代方案,从而向Java开发者提出最佳实践建议。在生成的多种实现中,我们重点研究了不同的并行化策略,并根据处理数据的特征解释了最高效的并行化策略。最后,生成命令式代码的代码生成流程定义了基线,可指导研究者和Java实现者优化Stream API。

0
下载
关闭预览

相关内容

Java 是一门编程语言,拥有跨平台、面向对象、泛型编程等特性。
【IJCAI2021】复杂知识库问答研究: 方法、挑战与对策
专知会员服务
57+阅读 · 2021年5月27日
专知会员服务
28+阅读 · 2021年3月7日
【新书】Java企业微服务,Enterprise Java Microservices,272页pdf
【AAAI2021】对比聚类,Contrastive Clustering
专知
26+阅读 · 2021年1月30日
TextInfoExp:自然语言处理相关实验(基于sougou数据集)
全球人工智能
12+阅读 · 2017年11月12日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
7+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
最新内容
学习数据的几何:形状空间分析数学综述
专知会员服务
7+阅读 · 6月17日
定向能反无人机系统最新发展动态
专知会员服务
8+阅读 · 6月17日
从燃煤战舰到算法战争:水面指挥的永恒要求
专知会员服务
6+阅读 · 6月17日
相关基金
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
7+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员