elm-explorations/benchmark/1.0.1

NOTE: the latest version is 1.0.2

Benchmark.Status

Report the status of a Benchmark.

Reporting

type Status
= Cold
| Unsized
| Pending Int Samples
| Failure Error
| Success Samples (Trend Quick)

Indicate the status of a benchmark.

  • Cold: We have not warmed up the JIT yet.

  • Unsized: We have not yet determined the best sample size for this benchmark.

  • Pending: We are in the process of collecting sample data. We will keep collecting sample data using the base sample size (first argument) until we have enough samples (numBuckets * samplesPerBucket.) We also store samples while in progress (second argument.)

  • Failure: We ran into an exception while collecting sample data. The attached Error tells us what went wrong.

  • Success: We finished collecting all our sample data (first argument.) We've calculated a trend using this data (second argument.)

See "The Life of a Benchmark" in the docs for Benchmark for an explanation of how these fit together.

progress : Status -> Float

How far along is this benchmark? This is a percentage, represented as a Float between 0 and 1.

type Error
= MeasurementError Error
| AnalysisError Error

Ways a benchmark can fail, expressed as either at runtime (in which case we have a LowLevel.Error) or while analyzing data (in which case we have a Trend.Math.Error.)

Runtime Configuration

How many buckets are samples spread out into?

How many samples will we take per bucket?

How far apart should the sample size for each bucket be?