bonsai

A library for building dynamic webapps, using Js_of_ocaml
Legend:
Library
Module
Module type
Parameter
Class
Class type
Library bonsai.bench
Module Bonsai_bench . Test
type t

t is equivalent to Core_bench_js.Test.t. We don't expose the equality because these benchmarks should only be run using Bonsai_bench.bench so that we can do necessary clean-up between benchmark runs.

val create : ?clock:Bonsai_test.Incr.Clock.t -> name:string -> component:'r Bonsai.Computation.t -> get_inject:( 'r -> 'a -> unit Bonsai_test.Effect.t ) -> 'a Interaction.t -> t

create produces a benchmark which performs interactions on component. The computation is shared between runs within the benchmark runner. Since they are run a non-deterministic amount of times, benchmarks created this way should either have an interaction which is idempotent on the state, or have similar performance when the interaction is repeated many times.

val create_with_resetter : ?clock:Bonsai_test.Incr.Clock.t -> name:string -> component:'r Bonsai.Computation.t -> get_inject:( 'r -> 'a -> unit Bonsai_test.Effect.t ) -> 'a Interaction.t -> t

create_with_resetter is equivalent to calling create, with interactions equal to Interaction.many interactions; Interaction.reset_model; Interaction.stabilize.