Automatic Microbenchmark Generation to Prevent Dead Code Elimination and Constant Folding

Marcelino Rodriguez-Cancio 1 Benoit Combemale 1 Benoit Baudry 1
1 DiverSe - Diversity-centric Software Engineering
IRISA-D4 - LANGAGE ET GÉNIE LOGICIEL, Inria Rennes – Bretagne Atlantique
Abstract : Microbenchmarking consists of evaluating, in isolation, the performance of small code segments that play a critical role in large applications. The accuracy of a microbenchmark depends on two critical tasks: wrap the code segment into a payload that faithfully recreates the execution conditions that occur in the large application; build a scaffold that runs the payload a large number of times to get a statistical estimate of the execution time. While recent frameworks such as the Java Microbenchmark Harness (JMH) take care of the scaffold challenge, developers have very limited support to build a correct payload. In this work, we focus on the automatic generation of pay-loads, starting from a code segment selected in a large application. In particular, we aim at preventing two of the most common mistakes made in microbenchmarks: dead code elimination and constant folding. Since a microbench-mark is such a small program, if not designed carefully, it will be " over-optimized " by the JIT and result in distorted time measures. Our technique hence automatically extracts the segment into a compilable payload and generates additional code to prevent the risks of " over-optimization ". The whole approach is embedded in a tool called AutoJMH, which generates payloads for JMH scaffolds. We validate the capabilities AutoJMH, showing that the tool is able to process a large percentage of segments in real programs. We also show that AutoJMH can match the quality of payloads handwritten by performance experts and outperform those written by professional Java developers without experience un microbenchmarking.
Liste complète des métadonnées

Cited literature [35 references]  Display  Hide  Download

https://hal.inria.fr/hal-01343818
Contributor : Marcelino Rodriguez-Cancio <>
Submitted on : Sunday, July 10, 2016 - 11:18:51 AM
Last modification on : Thursday, February 7, 2019 - 3:26:33 PM

File

technical-paper-main.pdf
Files produced by the author(s)

Licence


Distributed under a Creative Commons Attribution 4.0 International License

Identifiers

  • HAL Id : hal-01343818, version 1

Citation

Marcelino Rodriguez-Cancio, Benoit Combemale, Benoit Baudry. Automatic Microbenchmark Generation to Prevent Dead Code Elimination and Constant Folding. 31st IEEE/ACM International Conference on Automated Software Engineering (ASE 2016) , Sep 2016, Singapore, Singapore. ⟨hal-01343818⟩

Share

Metrics

Record views

1346

Files downloads

614