Journal of Computer Applications ›› 2015, Vol. 35 ›› Issue (11): 3172-3177.DOI: 10.11772/j.issn.1001-9081.2015.11.3172

• DPCS 2015 Paper • Previous Articles     Next Articles

Fork/Join-oriented software refactoring and performance analysis

ZHANG Dongwen, LIU Chenguang, ZHANG Yang   

  1. School of Information Science and Engineering, Hebei University of Science and Technology, Shijiazhuang Hebei 050000, China
  • Received:2015-06-17 Revised:2015-07-13 Published:2015-11-13

面向Fork/Join框架的软件重构及性能分析

张冬雯, 柳晨光, 张杨   

  1. 河北科技大学 信息科学与工程学院, 石家庄 050000
  • 通讯作者: 张杨(1980-),男,河北抚宁人,讲师,博士, CCF会员,主要研究方向:并行程序设计、软件重构、面向方面的理论与技术.
  • 作者简介:张冬雯(1964-),女,河北石家庄人,教授,博士,CCF会员,主要研究方向:软件重构、鲁棒控制、预测控制; 柳晨光(1993-),男,河北涞水人,硕士研究生,主要研究方向:并行计算、软件重构.
  • 基金资助:
    国家自然科学基金资助项目(61440012);河北省高等学校青年拔尖人才计划项目(BJ2014023).

Abstract: There are few works performed on the application and analysis of the Fork/Join framework at present. This paper refactored several benchmarks, including series, crypt, sparsematmult and sor, in the Java Grande Forum (JGF) benchmark suite by using Fork/Join framework. Taking the series benchmark as an example, detailed refactoring process was presented. In the experimentation, the execution time of each benchmark was evaluated with different threshold, and the execution time of Fork/Join framework was compared with that of multi-threaded version. Furthermore, the number of work-stealing operations was presented. The experimental results show that the execution time using Fork/Join framework can reduce 14.2% on average than that using multi-thread. When evaluating the series benchmark with data size sizeC and two threads, the execution time of Fork/Join framework is 40% lower than that with multi-thread. Programs using the Fork/Join framework can get better performance than that using multi-thread.

Key words: Fork/Join framework, software refactoring, work-stealing, performance analysis

摘要: 针对目前对于Fork/Join框架应用和性能分析的相关工作还不多的现状,以JGF基准测试程序套件为基础,对其中的series、crypt、sparsematmult和sor等程序使用Fork/Join框架进行重构,并以series程序为例,详细地说明了重构的过程.在实验中,首先,测试了每个程序在不同阈值下使用Fork/Join框架分别递归1、2、3次执行程序的时间,进而选择相对较好的阈值;然后,对每个程序使用Fork/Join框架和使用Thread的执行时间进行了对比;此外,测试了重构后的程序在执行过程中任务窃取的情况.实验结果表明,Fork/Join框架执行时间与多线程执行时间相比,平均降低了14.2%;对于series程序,当数据大小为sizeC且线程个数为2时,Fork/Join框架执行时间比多线程执行时间降低高达40%,可见,在多核处理器平台上应用Fork/Join框架比使用多线程将获得更好的性能.

关键词: Fork/Join框架, 软件重构, 工作窃取, 性能分析

CLC Number: