Automatically benchmark functions!
Author aminya
0 Stars
Updated Last
11 Months Ago
Started In
November 2019


Dev Build Status (Github Actions)

AcuteBenchmark allows you to benchmark functions that get Arrays as their input.

It is used inside IntelVectorMath for benchmarking its functions. A fully working example available here:

Creates random inputs for a function based on limits, types, and dims specified.

config = Funb(
    fun = sin,
    limits = [(-1,1)],
    types = [Float32, Float64],
    dims = [10 100 200],

or just in a compact form:

config = Funb( sin, [(-1,1)], [Float32, Float64], [10 100 200])
  • fun: the function :fun or :(
  • limits: min and max of possible values
  • types : type of elements
  • dims:
    • each element gives the size of the input, and it is a:
      • Number (for 1D)
      • Tuple (for N-D)
    • each row for each function argument
    • each column for each dimension set.

use benchmark! to run the benchmark:

using AcuteBenchmark

configs = FunbArray([
    Funb( sin, [(-1,1)],[Float32, Float64], [10] );
    Funb( atan, [(-1,1), (-1,1)],[Float32, Float64],[10; 10] );
    Funb( *, [(-1, 1), (-1, 1), (-1, 1)], [Float32, Float64], [(10,10); (10,10)] );


Plot the benchmark result using:



To have a same color for the same types use:

bar(configs, uniqueType = true, dimAnnotation = true)


To plot the relative speed, pass a pair of configs:

bar(configsRealBase => configsRealIVM, uniqueType = true, dimAnnotation = false, uniqueDim = true, "Base" => "IntelVectorMath")

IntelVectorMath Performance Comparison

To plot how the function acts over different dimension sets:

configs2 = Funb( sin, [(-1,1)],[Float32, Float64], [10 30 50 100 200 500] );

The axes are logarithmic.


To compare different sets pass an array of configs:

dimplot([configsRealBase,configsRealIVM],["Base", "IntelVectorMath"])

Use and AcuteBenchmark.load to read and write the benchmark data."test.jld2", configs)
configs_loaded = AcuteBenchmark.load("test.jld2")

Used By Packages

No packages found.