Module Mavryk_benchmarks_proto_001_PtAtLas.Cache_benchmarks

val assert_ok_lwt : ('a, 'b) Stdlib.result Lwt.t -> 'c
val assert_ok : ('a, 'b) Stdlib.result -> 'c

We can't construct a dummy cache client from outside the protocol. We'll have to benchmark the Environment_cache through the interface exposed by Script_cache.

Constructing a dummy cached value

val make_context : rng_state:Stdlib.Random.State.t -> Mavryk_raw_protocol_001_PtAtLas__Alpha_context.t
val throwaway_context : Mavryk_raw_protocol_001_PtAtLas__Alpha_context.t
val dummy_script : Cache.cached_contract

Creating dummy cache value identifiers.

module Cache_shared_config : sig ... end

Configuration shared among all cache benchmarks.

val identifier_of_int : int -> Cache.identifier
val prepare_context : Stdlib.Random.State.t -> int -> Mavryk_raw_protocol_001_PtAtLas.Alpha_context.context * Cache.identifier

Prepare a context with a cache of the prescribed cardinality. A key in the domain of the cache is returned along the context: this key is used to benchmark (successful) cache accesses.

Benchmark Script_cache.update. This almost directly calls Environment_cache.update. We also use the result of this benchmark to assign a cost to Environment_cache.find, which alas can't be directly benchmarked from the interface provided by Script_cache.