Module Test.Benchmark.Goodies

Some goodies for creating benchmarks. In particular, this module defines some operations to visualize benchmark results.

Author: Michael Hanus

Version: May 2021

Summary of exported operations:

showF2 :: Float -> String  Deterministic 
benchInputsResultsAsTable :: (String,String) -> [(String,String)] -> String  Deterministic 
Format simple benchmark results (i.e., a list of input/result pairs) as a latex table consisting of a row for input values and a row for result values.
benchResultsAsTable :: [String] -> [[String]] -> String  Deterministic 
Format benchmark results as a LaTeX table.
toTableRow :: [String] -> String  Deterministic 
Shows a list of strings as a LaTeX table row.
plotResults :: (Show a, Show b) => String -> [PlotStyle] -> [(String,[(a,b)])] -> IO ()  Non-deterministic 
Visualize a list of benchmarks results (i.e., lists of input/run-time pairs) as a plot graphic with gnuplot.

Exported datatypes:


PlotStyle

The various parameters to influence the style of the plot.

Constructors:

  • Lines :: PlotStyle : a line style plot
  • Histogram :: PlotStyle : a histogram style plot
  • Title :: String -> PlotStyle : the main title of the plot
  • XLabel :: String -> PlotStyle : the label of the x axis
  • YLabel :: String -> PlotStyle : the label of the y axis
  • XTicsRotate :: Int -> PlotStyle : the rotation of the tics on the x axis

Exported operations:

showF2 :: Float -> String  Deterministic 

benchInputsResultsAsTable :: (String,String) -> [(String,String)] -> String  Deterministic 

Format simple benchmark results (i.e., a list of input/result pairs) as a latex table consisting of a row for input values and a row for result values. The first argument is a pair of labels for the input/results rows.

benchResultsAsTable :: [String] -> [[String]] -> String  Deterministic 

Format benchmark results as a LaTeX table. The results are given as a table, i.e., as a list of rows. The first argument is the list of column labels for the benchmark data (second argument).

toTableRow :: [String] -> String  Deterministic 

Shows a list of strings as a LaTeX table row.

plotResults :: (Show a, Show b) => String -> [PlotStyle] -> [(String,[(a,b)])] -> IO ()  Non-deterministic 

Visualize a list of benchmarks results (i.e., lists of input/run-time pairs) as a plot graphic with gnuplot. Each benchmark result graph is provided with a title shown in the plot. The first argument is the plot name (i.e., the graphic will be stored in a JPEG file with suffix ".jpg" to this name). Further arguments are the plot style and the data to be plotted (represented as a pair of a title and the (x,y) values to be plotted).