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 WIP

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 WIP

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

Create benchmark from Plutarch term without tracing and no UPLC simplifier

@since WIP

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

Like bench but with customizable compilation config

@since WIP

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 WIP

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 WIP

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 WIP

Instances

Instances details
Eq CsvPath Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

Ord CsvPath Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

IsOption (Maybe CsvPath) Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

data FailIfMoreCpu Source #

@since WIP

Instances

Instances details
Num FailIfMoreCpu Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

Read FailIfMoreCpu Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

Fractional FailIfMoreCpu Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

Show FailIfMoreCpu Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

Eq FailIfMoreCpu Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

Ord FailIfMoreCpu Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

IsOption FailIfMoreCpu Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

data FailIfLessCpu Source #

@since WIP

Instances

Instances details
Num FailIfLessCpu Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

Read FailIfLessCpu Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

Fractional FailIfLessCpu Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

Show FailIfLessCpu Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

Eq FailIfLessCpu Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

Ord FailIfLessCpu Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

IsOption FailIfLessCpu Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

data FailIfMoreMem Source #

@since WIP

Instances

Instances details
Num FailIfMoreMem Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

Read FailIfMoreMem Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

Fractional FailIfMoreMem Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

Show FailIfMoreMem Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

Eq FailIfMoreMem Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

Ord FailIfMoreMem Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

IsOption FailIfMoreMem Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

data FailIfLessMem Source #

@since WIP

Instances

Instances details
Num FailIfLessMem Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

Read FailIfLessMem Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

Fractional FailIfLessMem Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

Show FailIfLessMem Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

Eq FailIfLessMem Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

Ord FailIfLessMem Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

IsOption FailIfLessMem Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

data FailIfBigger Source #

@since WIP

Instances

Instances details
Num FailIfBigger Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

Read FailIfBigger Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

Fractional FailIfBigger Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

Show FailIfBigger Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

Eq FailIfBigger Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

Ord FailIfBigger Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

IsOption FailIfBigger Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

data FailIfSmaller Source #

@since WIP

Instances

Instances details
Num FailIfSmaller Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

Read FailIfSmaller Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

Fractional FailIfSmaller Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

Show FailIfSmaller Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

Eq FailIfSmaller Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

Ord FailIfSmaller Source #

@since WIP

Instance details

Defined in Plutarch.Test.Bench

IsOption FailIfSmaller Source #

@since WIP

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 WIP

csvReporter :: Ingredient Source #

@since WIP