plutarch-testlib-1.0.0
Safe HaskellSafe-Inferred
LanguageGHC2021

Plutarch.Test.Bench

Description

Plutarch benchmarking tools

Interface mirrors the one from tasty-bench but bench instead of taking Benchmarkable takes ClosedTerm

To compare benchmark run against baseline file you need to generate it first with cabal run bench -- --csv baseline.csv. Then after making modifications you can rerun the benchmarks to compare with previous values with cabal run bench -- --baseline baseline.csv. You can instruct benchmarks to fail if certain values changed by too much using --fail-if-* flags. See cabal run bench -- --help for all available flags. To regenreate baseline file run with --csv flag again.

Synopsis

Documentation

data BenchConfig Source #

Since: 1.0.0

Constructors

Optimizing

Compile with UPLC simplifier pass and no tracing

NonOptimizing Config

Compile without UPLC simplifier and configurable tracing

defaultMain :: TestTree -> IO () Source #

Use this instead of defaultMain from Test.Tasty to run benchmarks to get formatted output

Since: 1.0.0

bench :: TestName -> ClosedTerm a -> TestTree Source #

Create benchmark from Plutarch term without tracing and no UPLC simplifier

Since: 1.0.0

benchWithConfig :: TestName -> BenchConfig -> ClosedTerm a -> TestTree Source #

Like bench but with customizable compilation config

Since: 1.0.0

bcompare Source #

Arguments

:: String

Tasty pattern to compare as baseline

-> TestTree

Test or test tree to compare with baseline test

-> TestTree 

Compare benchmarks, reporting relative CPU, MEM, and size differences

Since: 1.0.0

bcompareWithin Source #

Arguments

:: (Double, Double)

CPU bounds

-> (Double, Double)

MEM bounds

-> (Double, Double)

Size bounds

-> String

Tasty pattern to compare as baseline

-> TestTree

Test or test tree to compare with baseline test

-> TestTree 

Like bcompare but with customizable upper and lower bounds of relative differences

Since: 1.0.0

CLI options

Benchmarks can be compared against CSV file and fail if they differ too much. Run cabal run bench -- --help to see available flags and descriptions. These options are available by default when running benchmarks in defaultMain

data CsvPath Source #

Since: 1.0.0

Instances

Instances details
Eq CsvPath Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

Ord CsvPath Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

IsOption (Maybe CsvPath) Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

data FailIfMoreCpu Source #

Since: 1.0.0

Instances

Instances details
Num FailIfMoreCpu Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

Read FailIfMoreCpu Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

Fractional FailIfMoreCpu Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

Show FailIfMoreCpu Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

Eq FailIfMoreCpu Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

Ord FailIfMoreCpu Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

IsOption FailIfMoreCpu Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

data FailIfLessCpu Source #

Since: 1.0.0

Instances

Instances details
Num FailIfLessCpu Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

Read FailIfLessCpu Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

Fractional FailIfLessCpu Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

Show FailIfLessCpu Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

Eq FailIfLessCpu Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

Ord FailIfLessCpu Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

IsOption FailIfLessCpu Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

data FailIfMoreMem Source #

Since: 1.0.0

Instances

Instances details
Num FailIfMoreMem Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

Read FailIfMoreMem Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

Fractional FailIfMoreMem Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

Show FailIfMoreMem Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

Eq FailIfMoreMem Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

Ord FailIfMoreMem Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

IsOption FailIfMoreMem Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

data FailIfLessMem Source #

Since: 1.0.0

Instances

Instances details
Num FailIfLessMem Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

Read FailIfLessMem Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

Fractional FailIfLessMem Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

Show FailIfLessMem Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

Eq FailIfLessMem Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

Ord FailIfLessMem Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

IsOption FailIfLessMem Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

data FailIfBigger Source #

Since: 1.0.0

Instances

Instances details
Num FailIfBigger Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

Read FailIfBigger Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

Fractional FailIfBigger Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

Show FailIfBigger Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

Eq FailIfBigger Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

Ord FailIfBigger Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

IsOption FailIfBigger Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

data FailIfSmaller Source #

Since: 1.0.0

Instances

Instances details
Num FailIfSmaller Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

Read FailIfSmaller Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

Fractional FailIfSmaller Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

Show FailIfSmaller Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

Eq FailIfSmaller Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

Ord FailIfSmaller Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

IsOption FailIfSmaller Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Test.Bench

Ingredients

These are used by default in defaultMain. You do not need to do anything with them unless you build your own benchmark runner

consoleBenchReporter :: Ingredient Source #

Since: 1.0.0

csvReporter :: Ingredient Source #

Since: 1.0.0