Mavryk_benchmarks_proto_001_PtAtLas.Cache_benchmarks
val ns : Mavryk_benchmark.Namespace.cons
val fv : string -> Mavryk_benchmark.Free_variable.t
Alpha_context.Cache
-related benchmarksmodule Cache = Mavryk_protocol_001_PtAtLas.Protocol.Script_cache
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
.
val dummy_script : Cache.cached_contract
Configuration shared among all cache benchmarks.
val identifier_of_contract :
Mavryk_protocol_001_PtAtLas.Protocol.Contract_hash.t ->
Cache.identifier
val contract_of_int :
int ->
Mavryk_protocol_001_PtAtLas.Protocol.Contract_hash.t
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
.