一句话:提出低开销任务粒度剖析方法,揭示JVM任务并行瓶颈,并通过优化任务粒度获得最高5.90倍加速。
任务粒度是任务并行应用的关键性能属性:细粒度任务会带来可观的并行化开销,粗粒度任务则可能无法充分利用多核CPU,造成并行机会流失。本文面向共享内存多核上单个Java虚拟机内运行的任务并行应用,研究任务粒度问题。作者提出一种准确且高效采集每个已执行任务粒度的方法,并在一个开源剖析器中实现;该剖析器以低开销从整个系统栈收集精选指标,帮助开发者定位性能与可扩展性问题。文章使用DaCapo、ScalaBench和Spark Perf基准套件分析任务粒度,在若干应用中发现了与细粒度和粗粒度任务相关的低效现象,并证明所采集的任务粒度剖面可指导优化,最终在多个应用上取得最高5.90倍的加速。
Task granularity, i.e., the amount of work performed by parallel tasks, is a key performance attribute of parallel applications. On the one hand, fine-grained tasks (i.e., small tasks carrying out few computations) may introduce considerable parallelization overheads. On the other hand, coarse-grained tasks (i.e., large tasks performing substantial computations) may not fully utilize the available CPU cores, leading to missed parallelization opportunities. In this article, we provide a better understanding of task granularity for task-parallel applications running on a single Java Virtual Machine in a shared-memory multicore. We present a new methodology to accurately and efficiently collect the granularity of each executed task, implemented in a novel profiler (available open-source) that collects carefully selected metrics from the whole system stack with low overhead, and helps developers locate performance and scalability problems. We analyze task granularity in the DaCapo, ScalaBench, and Spark Perf benchmark suites, revealing inefficiencies related to fine-grained and coarse-grained tasks in several applications. We demonstrate that the collected task-granularity profiles are actionable by optimizing task granularity in several applications, achieving speedups up to a factor of 5.90×. Our results highlight the importance of analyzing and optimizing task granularity on the Java Virtual Machine.
DOI 原文 ·
@article{paperbot703,
title = {Analysis and Optimization of Task Granularity on the Java Virtual Machine},
author = {Andrea Rosà and Eduardo Rosales and Walter Binder},
journal = {ACM Transactions on Programming Languages and Systems},
volume = {41},
number = {3},
year = {2019},
doi = {10.1145/3338497}
}