Mavryk_benchmarks_proto_alpha.Cache_benchmarks
val ns : Mavryk_benchmark.Namespace.cons
val fv : string -> Mavryk_benchmark.Free_variable.t
Alpha_context.Cache
-related benchmarksmodule Admin = Mavryk_protocol_alpha.Protocol.Alpha_context.Cache.Admin
module Cache = Mavryk_protocol_alpha.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_alpha.Protocol.Contract_hash.t ->
Cache.identifier
val contract_of_int : int -> Mavryk_protocol_alpha.Protocol.Contract_hash.t
val identifier_of_int : int -> Cache.identifier
val prepare_context :
Stdlib.Random.State.t ->
int ->
Mavryk_raw_protocol_alpha.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
.