Not logged in.

Contribution Details

Type Bachelor's Thesis
Scope Discipline-based scholarship
Title A Correlation Study Between Source Code Features and Benchmark Stability
Organization Unit
Authors
  • Mikael Basmaci
Supervisors
  • Harald Gall
  • Christoph Laaber
Language
  • English
Institution University of Zurich
Faculty Faculty of Business, Economics and Informatics
Date 2019
Abstract Text Software microbenchmarks are used in Software Performance Engineering (SPE) to assess the performance of code fragments of a software system. Because they give non-deterministic results upon execution, there exists a certain variability in the results of microbenchmarks. Since the variability is an indicator of stability, the more variable the results, the less stable a microbenchmark is said to be. Studies show that the variability of microbenchmarks depend on different factors such as the hardware or platform the benchmarks are run on, the source code under the benchmark, or even the programming language itself. One of the factors that may affect the variability, hence the stability of a microbenchmark can be the source code features of the benchmark and the code it calls. Therefore, studying the correlation between stability and source code features of benchmarks may provide an insight into this aspect. In this thesis, I analyze variabilities of 4589 microbenchmarks from 223 open-source projects written in Go to find out about their stability, collect source code features of benchmarks by Abstract Syntax Tree (AST) parsing and callgraph analysis, and finally perform a correlation analysis based on the stability and source code features of benchmarks. Results show that 98.17% of the benchmarks have a variation below 10% as calculated by the 99th percent relative confidence interval width. Moreover, 87.70% of these benchmarks have a variability below 1%, meaning that most benchmarks are very stable. The results of correlation analysis show that 14 out of 59 collected source code features have a correlation coefficient value higher than 0.25, where the usage of sync library is the most correlating feature with a value of 0.36. This is followed by the usage of go keyword, which has the value 0.29. Generally, concurrency and control flow related features correlate with stability with a higher value than 0.22, while sync, sync/atomic and math/rand libraries correlate even more with a value above 0.25. An interesting finding reveals that pointers and defer statements are also relevant to stability. The findings from this study can be used by developers or tool designers to assess the stability of benchmarks as well as serve as a basis for predicting variability causes of microbenchmarks.
Zusammenfassung Software-Mikrobenchmarks werden im Software Performance Engineering (SPE) verwendet, um die Leistung von Codefragmenten eines Softwaresystems zu bewerten. Da sie bei der Ausführung nicht-deterministische Ergebnisse liefern, gibt es eine gewisse Variabilität in den Ergebnissen von Mikrobenchmarks. Die Variabilität ist ein Indikator für die Stabilität, je variabler die Ergebnisse, desto instabiler soll ein Mikrobenchmark sein. Studien zeigen, dass die Variabilität von Mikrobenchmarks von verschiedenen Faktoren wie zum Beispiel der Hardware oder Plattform abhängt, auf der die Benchmarks ausgeführt werden, dem Quellcode unter dem Benchmark oder sogar der Programmiersprache selbst. Einer der Faktoren, die die Variabilität und darum auch die Stabilität beeinflussen können, kann daher der Quellcode des Benchmarks und des vom Benchmark aufgerufenen Codes sein. Aus diesem Grund kann die Untersuchung des Zusammenhangs zwischen Stabilität und Quellcode-Eigenschaften von Benchmarks einen Einblick in diesen Aspekt geben. In dieser Arbeit analysiere ich die Variabilität von 4589 Mikrobenchmarks aus 223 Open-Source-Projekten, die in Go geschrieben wurden, um ihre Stabilität herauszufinden. Ausserdem sammle ich Quellcode-Features von Benchmarks durch Abstract Syntax Tree (AST) Parsing und Callgraph-Analyse und führe schließlich eine Korrelationsanalyse basierend auf der Stabilität und den Quellcode-Features von Benchmarks durch. Die Ergebnisse zeigen, dass 98,17% der Benchmarks eine Variation unter 10% aufweisen, berechnet aus der relativen Konfidenzintervallbreite von 99%. Darüber hinaus haben 87,70% dieser Benchmarks eine Variabilität unter 1%, was bedeutet, dass die meisten Benchmarks sehr stabil sind. Die Resultate der Korrelationsanalyse zeigen, dass 14 von 59 gesammelten Quellcode-Merkmalen einen Korrelationskoeffizientswert von mehr als 0,25 aufweisen, wobei die Verwendung der Sync-Bibliothek das am meisten korrelierende Merkmal mit einem Wert von 0,36 ist. Es folgt die Verwendung des go-Schlüsselwortes, das den Wert 0,29 hat. Im Allgemeinen korrelieren die Gleichzeitigkeitsund Kontrollfluss-Features mit der Stabilität mit einem höheren Wert als 0,22, während die Bibliotheken sync, sync/atomic und math/rand noch stärker mit einem Wert über 0,25 korrelieren. Ein interessanter Befund zeigt, dass Pointers und Defer-Anweisungen auch für die Stabilität relevant sind. Die Ergebnisse dieser Studie können von Entwicklern oder Tooldesignern genutzt werden, um die Stabilität von Benchmarks zu bewerten und als Grundlage für die Vorhersage von Variabilitätsursachen von Mikrobenchmarks zu dienen.
PDF File Download
Export BibTeX