Synchronous benchmarks must provide this trait. The apply
method defines a single iteration in a sample. Setup and Teardown are defined by the before
and after
methods respectively. The before
method runs before a sample of benchmarks and after
runs after the all iterations in the sample have completed. If your benchmark requires setup and/or teardown to occur beween each iteration of the benchmark, then you can use before_iteration
and after_iteration
methods respectively that run before/after each iteration.
trait iso MicroBenchmark
fun box name() : String val
fun box config() : BenchConfig val
fun box overhead() : MicroBenchmark iso^
fun ref before() : None val ?
fun ref before_iteration() : None val ?
fun ref apply() : None val ?
fun ref after() : None val ?
fun ref after_iteration() : None val ?
© 2016-2018, The Pony Developers
© 2014-2015, Causality Ltd.
Licensed under the BSD 2-Clause License.
https://stdlib.ponylang.io/ponybench-MicroBenchmark