Skip to content
wichtounet edited this page Sep 14, 2010 · 4 revisions

Welcome to the benchmark-utils wiki!

benchmark-utils is a simple library to facilitate benchmarks and generation of graphs.

Downloads

The library is distributed has a set of Jar files, the Jar of the library itself and the Jar of the dependencies.

You can donwload it here : benchmark-utils.tar.gz

Usage of the library

The usage is quite simple. By example, if you want to benchmark two methods :

public void method1(){
    //Code...
}

public void method2(){
    //Code...
}

Start creating a Benchs :

Benchs benchs = new Benchs("Title of the benchmark");

benchs.setFolder("folder_path"); 

folder_path indicates the folder were the graphs will be generated.

And let’s start the benchs :

benchs.bench("First method", new Runnable(){
    public void run() {
        method1();
    }
});

benchs.bench("Second method", new Runnable(){
    public void run() {
        method2();
    }
});

benchs.generateCharts(); 

The charts will be generated in the specified folder.

Sub chart

If in the first graph, there is some methods that takes a lot more time than the others methods, a sub chart will be generated including only the best methods. The methods to be removed from the graph to create the sub graph are selected using an exclusion factor. All the benchmarks with a mean exclusionFactor times higher than an other benchmark mean will be excluded. You can configure the exclusion factor using the setExclusionFactor setter. The default is 50.

Acknowledgments

The library is built around a micro-benchmarking framework created by Brent Boyer, head of Elliptic Group, Inc. You can have more informations about this framework on its website.