Mavryk_benchmarks_proto_001_PtAtLas.Cache_benchmarksval ns : Mavryk_benchmark.Namespace.consval fv : string -> Mavryk_benchmark.Free_variable.tAlpha_context.Cache-related benchmarksmodule Cache = Mavryk_protocol_001_PtAtLas.Protocol.Script_cacheWe 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.
val dummy_script : Cache.cached_contractConfiguration shared among all cache benchmarks.
val identifier_of_contract :
Mavryk_protocol_001_PtAtLas.Protocol.Contract_hash.t ->
Cache.identifierval contract_of_int :
int ->
Mavryk_protocol_001_PtAtLas.Protocol.Contract_hash.tval identifier_of_int : int -> Cache.identifierval prepare_context :
Stdlib.Random.State.t ->
int ->
Mavryk_raw_protocol_001_PtAtLas.Alpha_context.context * Cache.identifierPrepare 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.