From da52b628bc68f53e8ccd0fae59089f62b2e77968 Mon Sep 17 00:00:00 2001 From: Pavlo Khrystenko Date: Tue, 21 Mar 2023 15:06:31 +0100 Subject: [PATCH 1/6] Snoop: add generated_code_destination in shell_benchmarks --- .../bloomer_benchmarks.ml | 4 +++ .../encoding_benchmarks.ml | 4 +++ .../encoding_benchmarks_helpers.ml | 28 +++++++++++++++---- src/lib_shell_benchmarks/io_benchmarks.ml | 24 ++++++++++++++++ .../micheline_benchmarks.ml | 4 +++ src/lib_shell_benchmarks/misc_benchmarks.ml | 4 +++ .../encodings_benchmarks.ml | 2 ++ .../translator_benchmarks.ml | 2 ++ 8 files changed, 67 insertions(+), 5 deletions(-) diff --git a/src/lib_shell_benchmarks/bloomer_benchmarks.ml b/src/lib_shell_benchmarks/bloomer_benchmarks.ml index 7d84c1f2069e..ebe4b5f63c72 100644 --- a/src/lib_shell_benchmarks/bloomer_benchmarks.ml +++ b/src/lib_shell_benchmarks/bloomer_benchmarks.ml @@ -44,6 +44,10 @@ let make_bench ~name ~info ~model ~generator ~make_bench : let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let config_encoding = Data_encoding.unit type workload = unit diff --git a/src/lib_shell_benchmarks/encoding_benchmarks.ml b/src/lib_shell_benchmarks/encoding_benchmarks.ml index 8666f696c341..ddefa48ef4ee 100644 --- a/src/lib_shell_benchmarks/encoding_benchmarks.ml +++ b/src/lib_shell_benchmarks/encoding_benchmarks.ml @@ -27,6 +27,10 @@ open Benchmarks_shell open Encoding_benchmarks_helpers.Make (struct let file = __FILE__ + + let generated_code_destination = None + + let () = ignore generated_code_destination end) (* ------------------------------------------------------------------------- *) diff --git a/src/lib_shell_benchmarks/encoding_benchmarks_helpers.ml b/src/lib_shell_benchmarks/encoding_benchmarks_helpers.ml index a0f74edd7ce4..8931a4616ec2 100644 --- a/src/lib_shell_benchmarks/encoding_benchmarks_helpers.ml +++ b/src/lib_shell_benchmarks/encoding_benchmarks_helpers.ml @@ -59,8 +59,10 @@ module Shared_linear = struct Sparse_vec.String.of_list [("bytes", float_of_int bytes)] end -module Make (Filename : sig +module Make (Info : sig val file : string + + val generated_code_destination : string option end) = struct (* Generic function to cook benchmarks for fixed-size encodings *) @@ -84,7 +86,11 @@ struct let info = Format.asprintf "Benchmarking %a" Namespace.pp name - let module_filename = Filename.file + let module_filename = Info.file + + let generated_code_destination = Info.generated_code_destination + + let () = ignore generated_code_destination let tags = ["encoding"] @@ -113,7 +119,11 @@ struct let info = Format.asprintf "Benchmarking %a" Namespace.pp name - let module_filename = Filename.file + let module_filename = Info.file + + let generated_code_destination = Info.generated_code_destination + + let () = ignore generated_code_destination let tags = ["encoding"] @@ -143,7 +153,11 @@ struct let info = Format.asprintf "Benchmarking %a" Namespace.pp name - let module_filename = Filename.file + let module_filename = Info.file + + let generated_code_destination = Info.generated_code_destination + + let () = ignore generated_code_destination let tags = ["encoding"] @@ -161,7 +175,11 @@ struct let info = Format.asprintf "Benchmarking %a (intercept case)" Namespace.pp name - let module_filename = Filename.file + let module_filename = Info.file + + let generated_code_destination = Info.generated_code_destination + + let () = ignore generated_code_destination let tags = ["encoding"] diff --git a/src/lib_shell_benchmarks/io_benchmarks.ml b/src/lib_shell_benchmarks/io_benchmarks.ml index d6af812df542..12a29c2e666b 100644 --- a/src/lib_shell_benchmarks/io_benchmarks.ml +++ b/src/lib_shell_benchmarks/io_benchmarks.ml @@ -268,6 +268,10 @@ module Context_size_dependent_read_bench : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + include Context_size_dependent_shared let make_bench rng_state cfg () = @@ -355,6 +359,10 @@ module Context_size_dependent_write_bench : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let tags = ["io"] let write_storage context key bytes = @@ -575,6 +583,10 @@ module Irmin_pack_read_bench : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let tags = ["io"] type workload = @@ -742,6 +754,10 @@ module Irmin_pack_write_bench : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let tags = ["io"] type workload = @@ -904,6 +920,10 @@ module Read_random_key_bench : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let tags = ["io"] type workload = Read_random_key of {depth : int; storage_bytes : int} @@ -1049,6 +1069,10 @@ module Write_random_keys_bench : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let tags = ["io"] type workload = diff --git a/src/lib_shell_benchmarks/micheline_benchmarks.ml b/src/lib_shell_benchmarks/micheline_benchmarks.ml index facc69a42af3..cc17f5a83968 100644 --- a/src/lib_shell_benchmarks/micheline_benchmarks.ml +++ b/src/lib_shell_benchmarks/micheline_benchmarks.ml @@ -135,6 +135,10 @@ module Micheline_strip_locations : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let tags = ["micheline"] type config = unit diff --git a/src/lib_shell_benchmarks/misc_benchmarks.ml b/src/lib_shell_benchmarks/misc_benchmarks.ml index 92db44d0ee13..2f2d1bbb137c 100644 --- a/src/lib_shell_benchmarks/misc_benchmarks.ml +++ b/src/lib_shell_benchmarks/misc_benchmarks.ml @@ -48,6 +48,10 @@ module Lwt_main_run_bench : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let tags = ["misc"] let models = [("*", lwt_model)] diff --git a/src/proto_alpha/lib_benchmarks_proto/encodings_benchmarks.ml b/src/proto_alpha/lib_benchmarks_proto/encodings_benchmarks.ml index 34027d0f0834..8e01e20e2abb 100644 --- a/src/proto_alpha/lib_benchmarks_proto/encodings_benchmarks.ml +++ b/src/proto_alpha/lib_benchmarks_proto/encodings_benchmarks.ml @@ -28,6 +28,8 @@ open Protocol module Encodings = Tezos_shell_benchmarks.Encoding_benchmarks_helpers.Make (struct let file = __FILE__ + + let generated_code_destination = None end) module Size = Gas_input_size diff --git a/src/proto_alpha/lib_benchmarks_proto/translator_benchmarks.ml b/src/proto_alpha/lib_benchmarks_proto/translator_benchmarks.ml index 1ac41b09d433..fac547d5d4ea 100644 --- a/src/proto_alpha/lib_benchmarks_proto/translator_benchmarks.ml +++ b/src/proto_alpha/lib_benchmarks_proto/translator_benchmarks.ml @@ -28,6 +28,8 @@ open Protocol module Encodings = Tezos_shell_benchmarks.Encoding_benchmarks_helpers.Make (struct let file = __FILE__ + + let generated_code_destination = None end) module Size = Gas_input_size -- GitLab From 3ec2eaa65893bcb583884b86cb733316797f7532 Mon Sep 17 00:00:00 2001 From: Pavlo Khrystenko Date: Tue, 21 Mar 2023 15:12:43 +0100 Subject: [PATCH 2/6] Snoop: add generated_code_destination in lib_benchmark_proto --- .../lib_benchmarks_proto/apply_benchmarks.ml | 4 +++ .../lib_benchmarks_proto/benchmarks_proto.ml | 2 -- .../lib_benchmarks_proto/cache_benchmarks.ml | 4 +++ .../carbonated_map_benchmarks.ml | 12 ++++++++ .../encodings_benchmarks.ml | 8 ++++++ .../global_constants_storage_benchmarks.ml | 24 ++++++++++++++++ .../interpreter_benchmarks.ml | 16 +++++++++++ .../sapling_benchmarks.ml | 4 +++ .../sc_rollup_benchmarks.ml | 8 ++++++ .../script_repr_benchmarks.ml | 8 ++++++ .../script_typed_ir_size_benchmarks.ml | 16 +++++++++++ .../storage_benchmarks.ml | 8 ++++++ .../lib_benchmarks_proto/ticket_benchmarks.ml | 16 +++++++++++ .../translator_benchmarks.ml | 28 +++++++++++++++++++ 14 files changed, 156 insertions(+), 2 deletions(-) diff --git a/src/proto_alpha/lib_benchmarks_proto/apply_benchmarks.ml b/src/proto_alpha/lib_benchmarks_proto/apply_benchmarks.ml index 02cd860880e7..4dca7cd3171d 100644 --- a/src/proto_alpha/lib_benchmarks_proto/apply_benchmarks.ml +++ b/src/proto_alpha/lib_benchmarks_proto/apply_benchmarks.ml @@ -64,6 +64,10 @@ module Take_fees_benchmark = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let tags = ["apply"] type config = unit diff --git a/src/proto_alpha/lib_benchmarks_proto/benchmarks_proto.ml b/src/proto_alpha/lib_benchmarks_proto/benchmarks_proto.ml index a541164ad48c..5f593c3b622f 100644 --- a/src/proto_alpha/lib_benchmarks_proto/benchmarks_proto.ml +++ b/src/proto_alpha/lib_benchmarks_proto/benchmarks_proto.ml @@ -73,8 +73,6 @@ module Registration = struct (destination ^ "_costs_generated.ml")) Bench.generated_code_destination - (* The value will be used later in lib_benchmark/registration.ml for - codegen file destination. *) let () = ignore generated_code_destination let models = diff --git a/src/proto_alpha/lib_benchmarks_proto/cache_benchmarks.ml b/src/proto_alpha/lib_benchmarks_proto/cache_benchmarks.ml index cda89ebf7ca5..6702c75cb267 100644 --- a/src/proto_alpha/lib_benchmarks_proto/cache_benchmarks.ml +++ b/src/proto_alpha/lib_benchmarks_proto/cache_benchmarks.ml @@ -135,6 +135,10 @@ module Cache_update_benchmark : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + (** It is expected that cache keys are non-adversarial, ie do not share a long common prefix. This is the case for [Script_cache], for which the keys are B58-encoded contract hashes. diff --git a/src/proto_alpha/lib_benchmarks_proto/carbonated_map_benchmarks.ml b/src/proto_alpha/lib_benchmarks_proto/carbonated_map_benchmarks.ml index 6f99987cd040..7ba9be0c35d2 100644 --- a/src/proto_alpha/lib_benchmarks_proto/carbonated_map_benchmarks.ml +++ b/src/proto_alpha/lib_benchmarks_proto/carbonated_map_benchmarks.ml @@ -47,6 +47,10 @@ module Config_and_workload = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let tags = ["carbonated_map"] let workload_encoding = config_encoding @@ -165,6 +169,10 @@ module Make (CS : COMPARABLE_SAMPLER) = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let models = [ ( "carbonated_map", @@ -304,6 +312,10 @@ module Make (CS : COMPARABLE_SAMPLER) = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let models = [ ( "carbonated_map", diff --git a/src/proto_alpha/lib_benchmarks_proto/encodings_benchmarks.ml b/src/proto_alpha/lib_benchmarks_proto/encodings_benchmarks.ml index 8e01e20e2abb..db4d87e7b607 100644 --- a/src/proto_alpha/lib_benchmarks_proto/encodings_benchmarks.ml +++ b/src/proto_alpha/lib_benchmarks_proto/encodings_benchmarks.ml @@ -139,6 +139,10 @@ module Encoding_micheline : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let micheline_serialization_trace (micheline_node : Alpha_context.Script.node) = match @@ -207,6 +211,10 @@ module Decoding_micheline : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let micheline_deserialization_trace (micheline_str : string) = match Data_encoding.Binary.of_string diff --git a/src/proto_alpha/lib_benchmarks_proto/global_constants_storage_benchmarks.ml b/src/proto_alpha/lib_benchmarks_proto/global_constants_storage_benchmarks.ml index 39859a11d5a6..ec6fbe7add3e 100644 --- a/src/proto_alpha/lib_benchmarks_proto/global_constants_storage_benchmarks.ml +++ b/src/proto_alpha/lib_benchmarks_proto/global_constants_storage_benchmarks.ml @@ -298,6 +298,10 @@ module Set_add : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let tags = ["global_constants"] type config = unit @@ -351,6 +355,10 @@ module Set_elements : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let tags = ["global_constants"] type config = unit @@ -406,6 +414,10 @@ module Script_expr_hash_of_b58check_opt : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let tags = ["global_constants"] type config = unit @@ -476,6 +488,10 @@ struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let tags = ["global_constants"] type config = unit @@ -558,6 +574,10 @@ module Global_constants_storage_expand_models = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let tags = ["global_constants"] type config = unit @@ -631,6 +651,10 @@ module Global_constants_storage_expand_models = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let tags = ["global_constants"] type config = unit diff --git a/src/proto_alpha/lib_benchmarks_proto/interpreter_benchmarks.ml b/src/proto_alpha/lib_benchmarks_proto/interpreter_benchmarks.ml index 73ec037dd88b..666344a7333b 100644 --- a/src/proto_alpha/lib_benchmarks_proto/interpreter_benchmarks.ml +++ b/src/proto_alpha/lib_benchmarks_proto/interpreter_benchmarks.ml @@ -274,6 +274,10 @@ let make_benchmark : let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let benchmark kinstr_and_stack_sampler ctxt step_constants () = let stack_instr = kinstr_and_stack_sampler () in benchmark_from_kinstr_and_stack @@ -556,6 +560,10 @@ let make_continuation_benchmark : let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let benchmark cont_and_stack_sampler ctxt step_constants () = let stack_instr = cont_and_stack_sampler () in benchmark_from_continuation ?amplification ctxt step_constants stack_instr @@ -653,6 +661,10 @@ module Registration_section = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let tags = [Tags.interpreter] type config = {max_iterations : int} @@ -2724,6 +2736,10 @@ module Registration_section = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + include Default_config include Default_boilerplate diff --git a/src/proto_alpha/lib_benchmarks_proto/sapling_benchmarks.ml b/src/proto_alpha/lib_benchmarks_proto/sapling_benchmarks.ml index 63955d43b65d..72afe3842afc 100644 --- a/src/proto_alpha/lib_benchmarks_proto/sapling_benchmarks.ml +++ b/src/proto_alpha/lib_benchmarks_proto/sapling_benchmarks.ml @@ -40,6 +40,10 @@ module Apply_diff_bench : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let tags = ["sapling"] let diff_from_tx (tx : Alpha_context.Sapling.transaction) = diff --git a/src/proto_alpha/lib_benchmarks_proto/sc_rollup_benchmarks.ml b/src/proto_alpha/lib_benchmarks_proto/sc_rollup_benchmarks.ml index e5f8f7dddb0b..e8af982a1280 100644 --- a/src/proto_alpha/lib_benchmarks_proto/sc_rollup_benchmarks.ml +++ b/src/proto_alpha/lib_benchmarks_proto/sc_rollup_benchmarks.ml @@ -290,6 +290,10 @@ module Sc_rollup_verify_output_proof_benchmark = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let tags = ["sc_rollup"] type config = { @@ -507,6 +511,10 @@ module Sc_rollup_deserialize_output_proof_benchmark = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let tags = ["sc_rollup"] type config = { diff --git a/src/proto_alpha/lib_benchmarks_proto/script_repr_benchmarks.ml b/src/proto_alpha/lib_benchmarks_proto/script_repr_benchmarks.ml index a69895df80f0..a648c283cdbe 100644 --- a/src/proto_alpha/lib_benchmarks_proto/script_repr_benchmarks.ml +++ b/src/proto_alpha/lib_benchmarks_proto/script_repr_benchmarks.ml @@ -82,6 +82,10 @@ module Micheline_nodes_benchmark : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let size_based_model = Model.make ~conv:(function {micheline_nodes} -> (micheline_nodes, ())) @@ -123,6 +127,10 @@ module Script_repr_strip_annotations : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let strip_annotations_model = Model.( make diff --git a/src/proto_alpha/lib_benchmarks_proto/script_typed_ir_size_benchmarks.ml b/src/proto_alpha/lib_benchmarks_proto/script_typed_ir_size_benchmarks.ml index bbcdc23ca0d9..ca630f0e1147 100644 --- a/src/proto_alpha/lib_benchmarks_proto/script_typed_ir_size_benchmarks.ml +++ b/src/proto_alpha/lib_benchmarks_proto/script_typed_ir_size_benchmarks.ml @@ -79,6 +79,10 @@ end = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let value_size_benchmark rng_state (node : Protocol.Script_repr.expr) (michelson_type : Script_repr.expr) = (* FIXME: cleanup and factorize this code between translator benches and these ones. *) @@ -152,6 +156,10 @@ module Type_size_benchmark : Tezos_benchmark.Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let models = [(model_name, size_based_model (Namespace.basename name))] let type_size_benchmark (Script_typed_ir.Ex_ty ty) = @@ -196,6 +204,10 @@ end = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let kinstr_size_benchmark rng_state (expr : Protocol.Script_repr.expr) (stack : Script_repr.expr list) = (* FIXME: cleanup and factorize this code between translator benches and these ones. *) @@ -275,6 +287,10 @@ module Node_size_benchmark : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let size_based_model = Model.make ~conv:(function {micheline_nodes} -> (micheline_nodes, ())) diff --git a/src/proto_alpha/lib_benchmarks_proto/storage_benchmarks.ml b/src/proto_alpha/lib_benchmarks_proto/storage_benchmarks.ml index 467777dff546..347a8f055976 100644 --- a/src/proto_alpha/lib_benchmarks_proto/storage_benchmarks.ml +++ b/src/proto_alpha/lib_benchmarks_proto/storage_benchmarks.ml @@ -183,6 +183,10 @@ module List_key_values_benchmark = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let benchmark rng_state {max_size} () = let wrap m = m >|= Environment.wrap_tzresult in let size = @@ -223,6 +227,10 @@ module List_key_values_benchmark_intercept = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let benchmark _rng_state _config () = let ctxt = match Lwt_main.run (default_raw_context ()) with diff --git a/src/proto_alpha/lib_benchmarks_proto/ticket_benchmarks.ml b/src/proto_alpha/lib_benchmarks_proto/ticket_benchmarks.ml index 471f90a4ee49..517702ab1813 100644 --- a/src/proto_alpha/lib_benchmarks_proto/ticket_benchmarks.ml +++ b/src/proto_alpha/lib_benchmarks_proto/ticket_benchmarks.ml @@ -85,6 +85,10 @@ module Compare_ticket_hash_benchmark : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let compare_model = Model.make ~conv:(fun () -> ()) @@ -138,6 +142,10 @@ module Compare_key_contract_benchmark : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let compare_model = Model.make ~conv:(fun () -> ()) @@ -198,6 +206,10 @@ module Has_tickets_type_benchmark : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let make_bench_helper rng_state config () = let open Result_syntax in let* ctxt, _ = Lwt_main.run (Execution_context.make ~rng_state) in @@ -253,6 +265,10 @@ module Collect_tickets_benchmark : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let make_bench_helper rng_state config () = let open Script_typed_ir in let open Result_syntax in diff --git a/src/proto_alpha/lib_benchmarks_proto/translator_benchmarks.ml b/src/proto_alpha/lib_benchmarks_proto/translator_benchmarks.ml index fac547d5d4ea..729258f1ca48 100644 --- a/src/proto_alpha/lib_benchmarks_proto/translator_benchmarks.ml +++ b/src/proto_alpha/lib_benchmarks_proto/translator_benchmarks.ml @@ -205,6 +205,10 @@ module Typechecking_data : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let typechecking_data_benchmark rng_state (node : Protocol.Script_repr.expr) (michelson_type : Script_repr.expr) = Lwt_main.run @@ -279,6 +283,10 @@ module Unparsing_data : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let unparsing_data_benchmark rng_state (node : Protocol.Script_repr.expr) (michelson_type : Protocol.Script_repr.expr) = Lwt_main.run @@ -360,6 +368,10 @@ module Typechecking_code : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let typechecking_code_benchmark rng_state (node : Protocol.Script_repr.expr) (stack : Script_repr.expr list) = Lwt_main.run @@ -438,6 +450,10 @@ module Unparsing_code : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let unparsing_code_benchmark rng_state (node : Protocol.Script_repr.expr) (stack : Script_repr.expr list) = Lwt_main.run @@ -569,6 +585,10 @@ module Ty_eq : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let tags = [Tags.translator] let intercept_var = fv (Format.asprintf "%s_const" (Namespace.basename name)) @@ -716,6 +736,10 @@ module Parse_type_benchmark : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let make_bench rng_state config () = ( Lwt_main.run (Execution_context.make ~rng_state) >>? fun (ctxt, _) -> let ctxt = Gas_helpers.set_limit ctxt in @@ -770,6 +794,10 @@ module Unparse_type_benchmark : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + + let () = ignore generated_code_destination + let make_bench rng_state config () = ( Lwt_main.run (Execution_context.make ~rng_state) >>? fun (ctxt, _) -> let ctxt = Gas_helpers.set_limit ctxt in -- GitLab From ca37857b92d62f869137bd059a0a82c5ca4039df Mon Sep 17 00:00:00 2001 From: Pavlo Khrystenko Date: Tue, 21 Mar 2023 14:59:28 +0100 Subject: [PATCH 3/6] Snoop: add generated_code_destination to Benchmark.S in lib_benchmark --- src/lib_benchmark/benchmark.ml | 3 +++ src/lib_benchmark/builtin_benchmarks.ml | 2 ++ src/lib_benchmark/example/blake2b.ml | 2 ++ src/lib_benchmark/test/test_probe.ml | 2 ++ src/lib_shell_benchmarks/bloomer_benchmarks.ml | 2 -- src/lib_shell_benchmarks/encoding_benchmarks.ml | 2 -- .../encoding_benchmarks_helpers.ml | 8 -------- src/lib_shell_benchmarks/io_benchmarks.ml | 12 ------------ src/lib_shell_benchmarks/micheline_benchmarks.ml | 2 -- src/lib_shell_benchmarks/misc_benchmarks.ml | 2 -- .../lib_benchmarks_proto/apply_benchmarks.ml | 2 -- .../lib_benchmarks_proto/benchmarks_proto.ml | 2 -- .../lib_benchmarks_proto/cache_benchmarks.ml | 2 -- .../carbonated_map_benchmarks.ml | 6 ------ .../lib_benchmarks_proto/encodings_benchmarks.ml | 4 ---- .../global_constants_storage_benchmarks.ml | 12 ------------ .../lib_benchmarks_proto/interpreter_benchmarks.ml | 8 -------- .../lib_benchmarks_proto/sapling_benchmarks.ml | 2 -- .../lib_benchmarks_proto/sc_rollup_benchmarks.ml | 4 ---- .../lib_benchmarks_proto/script_repr_benchmarks.ml | 4 ---- .../script_typed_ir_size_benchmarks.ml | 8 -------- .../lib_benchmarks_proto/storage_benchmarks.ml | 4 ---- .../lib_benchmarks_proto/ticket_benchmarks.ml | 8 -------- .../lib_benchmarks_proto/translator_benchmarks.ml | 14 -------------- 24 files changed, 9 insertions(+), 108 deletions(-) diff --git a/src/lib_benchmark/benchmark.ml b/src/lib_benchmark/benchmark.ml index 35f7bdac1956..ae7881b7977e 100644 --- a/src/lib_benchmark/benchmark.ml +++ b/src/lib_benchmark/benchmark.ml @@ -37,6 +37,9 @@ module type S = sig (** File where the benchmark module is defined *) val module_filename : string + (** Destination of generated code *) + val generated_code_destination : string option + (** Tags of the benchmark *) val tags : string list diff --git a/src/lib_benchmark/builtin_benchmarks.ml b/src/lib_benchmark/builtin_benchmarks.ml index 7e9a11cfb93d..3edfb0ce5486 100644 --- a/src/lib_benchmark/builtin_benchmarks.ml +++ b/src/lib_benchmark/builtin_benchmarks.ml @@ -42,6 +42,8 @@ module Timer_latency_bench : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let tags = ["misc"; "builtin"] let models = [("*", Model.(make ~conv:(fun () -> ()) ~model:Model.zero))] diff --git a/src/lib_benchmark/example/blake2b.ml b/src/lib_benchmark/example/blake2b.ml index af1d77d6c884..5d969c8c737a 100644 --- a/src/lib_benchmark/example/blake2b.ml +++ b/src/lib_benchmark/example/blake2b.ml @@ -50,6 +50,8 @@ module Blake2b_bench : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let tags = ["example"] (* We will measure hashing time on random bytes with length diff --git a/src/lib_benchmark/test/test_probe.ml b/src/lib_benchmark/test/test_probe.ml index 80b4bb6650e0..7216bbda3ac9 100644 --- a/src/lib_benchmark/test/test_probe.ml +++ b/src/lib_benchmark/test/test_probe.ml @@ -59,6 +59,8 @@ module Probing_bench = struct let module_filename = __FILE__ + let generated_code_destination = None + (* The encoding is used by `tezos-snoop` to load the config from json files. *) let config_encoding = diff --git a/src/lib_shell_benchmarks/bloomer_benchmarks.ml b/src/lib_shell_benchmarks/bloomer_benchmarks.ml index ebe4b5f63c72..29fc3f065352 100644 --- a/src/lib_shell_benchmarks/bloomer_benchmarks.ml +++ b/src/lib_shell_benchmarks/bloomer_benchmarks.ml @@ -46,8 +46,6 @@ let make_bench ~name ~info ~model ~generator ~make_bench : let generated_code_destination = None - let () = ignore generated_code_destination - let config_encoding = Data_encoding.unit type workload = unit diff --git a/src/lib_shell_benchmarks/encoding_benchmarks.ml b/src/lib_shell_benchmarks/encoding_benchmarks.ml index ddefa48ef4ee..d3c091c2733d 100644 --- a/src/lib_shell_benchmarks/encoding_benchmarks.ml +++ b/src/lib_shell_benchmarks/encoding_benchmarks.ml @@ -29,8 +29,6 @@ open Encoding_benchmarks_helpers.Make (struct let file = __FILE__ let generated_code_destination = None - - let () = ignore generated_code_destination end) (* ------------------------------------------------------------------------- *) diff --git a/src/lib_shell_benchmarks/encoding_benchmarks_helpers.ml b/src/lib_shell_benchmarks/encoding_benchmarks_helpers.ml index 8931a4616ec2..7cda1644e7c5 100644 --- a/src/lib_shell_benchmarks/encoding_benchmarks_helpers.ml +++ b/src/lib_shell_benchmarks/encoding_benchmarks_helpers.ml @@ -90,8 +90,6 @@ struct let generated_code_destination = Info.generated_code_destination - let () = ignore generated_code_destination - let tags = ["encoding"] include Shared_constant_time @@ -123,8 +121,6 @@ struct let generated_code_destination = Info.generated_code_destination - let () = ignore generated_code_destination - let tags = ["encoding"] include Shared_linear @@ -157,8 +153,6 @@ struct let generated_code_destination = Info.generated_code_destination - let () = ignore generated_code_destination - let tags = ["encoding"] include Shared_linear @@ -179,8 +173,6 @@ struct let generated_code_destination = Info.generated_code_destination - let () = ignore generated_code_destination - let tags = ["encoding"] include Shared_linear diff --git a/src/lib_shell_benchmarks/io_benchmarks.ml b/src/lib_shell_benchmarks/io_benchmarks.ml index 12a29c2e666b..ba79f7301191 100644 --- a/src/lib_shell_benchmarks/io_benchmarks.ml +++ b/src/lib_shell_benchmarks/io_benchmarks.ml @@ -270,8 +270,6 @@ module Context_size_dependent_read_bench : Benchmark.S = struct let generated_code_destination = None - let () = ignore generated_code_destination - include Context_size_dependent_shared let make_bench rng_state cfg () = @@ -361,8 +359,6 @@ module Context_size_dependent_write_bench : Benchmark.S = struct let generated_code_destination = None - let () = ignore generated_code_destination - let tags = ["io"] let write_storage context key bytes = @@ -585,8 +581,6 @@ module Irmin_pack_read_bench : Benchmark.S = struct let generated_code_destination = None - let () = ignore generated_code_destination - let tags = ["io"] type workload = @@ -756,8 +750,6 @@ module Irmin_pack_write_bench : Benchmark.S = struct let generated_code_destination = None - let () = ignore generated_code_destination - let tags = ["io"] type workload = @@ -922,8 +914,6 @@ module Read_random_key_bench : Benchmark.S = struct let generated_code_destination = None - let () = ignore generated_code_destination - let tags = ["io"] type workload = Read_random_key of {depth : int; storage_bytes : int} @@ -1071,8 +1061,6 @@ module Write_random_keys_bench : Benchmark.S = struct let generated_code_destination = None - let () = ignore generated_code_destination - let tags = ["io"] type workload = diff --git a/src/lib_shell_benchmarks/micheline_benchmarks.ml b/src/lib_shell_benchmarks/micheline_benchmarks.ml index cc17f5a83968..ba00a6895868 100644 --- a/src/lib_shell_benchmarks/micheline_benchmarks.ml +++ b/src/lib_shell_benchmarks/micheline_benchmarks.ml @@ -137,8 +137,6 @@ module Micheline_strip_locations : Benchmark.S = struct let generated_code_destination = None - let () = ignore generated_code_destination - let tags = ["micheline"] type config = unit diff --git a/src/lib_shell_benchmarks/misc_benchmarks.ml b/src/lib_shell_benchmarks/misc_benchmarks.ml index 2f2d1bbb137c..6c6a15f78f4e 100644 --- a/src/lib_shell_benchmarks/misc_benchmarks.ml +++ b/src/lib_shell_benchmarks/misc_benchmarks.ml @@ -50,8 +50,6 @@ module Lwt_main_run_bench : Benchmark.S = struct let generated_code_destination = None - let () = ignore generated_code_destination - let tags = ["misc"] let models = [("*", lwt_model)] diff --git a/src/proto_alpha/lib_benchmarks_proto/apply_benchmarks.ml b/src/proto_alpha/lib_benchmarks_proto/apply_benchmarks.ml index 4dca7cd3171d..5aa82f42132a 100644 --- a/src/proto_alpha/lib_benchmarks_proto/apply_benchmarks.ml +++ b/src/proto_alpha/lib_benchmarks_proto/apply_benchmarks.ml @@ -66,8 +66,6 @@ module Take_fees_benchmark = struct let generated_code_destination = None - let () = ignore generated_code_destination - let tags = ["apply"] type config = unit diff --git a/src/proto_alpha/lib_benchmarks_proto/benchmarks_proto.ml b/src/proto_alpha/lib_benchmarks_proto/benchmarks_proto.ml index 5f593c3b622f..ffde3a4612f6 100644 --- a/src/proto_alpha/lib_benchmarks_proto/benchmarks_proto.ml +++ b/src/proto_alpha/lib_benchmarks_proto/benchmarks_proto.ml @@ -73,8 +73,6 @@ module Registration = struct (destination ^ "_costs_generated.ml")) Bench.generated_code_destination - let () = ignore generated_code_destination - let models = [(Namespace.(cons name "model" |> to_string), Bench.model ~name)] diff --git a/src/proto_alpha/lib_benchmarks_proto/cache_benchmarks.ml b/src/proto_alpha/lib_benchmarks_proto/cache_benchmarks.ml index 6702c75cb267..be05760b2fc2 100644 --- a/src/proto_alpha/lib_benchmarks_proto/cache_benchmarks.ml +++ b/src/proto_alpha/lib_benchmarks_proto/cache_benchmarks.ml @@ -137,8 +137,6 @@ module Cache_update_benchmark : Benchmark.S = struct let generated_code_destination = None - let () = ignore generated_code_destination - (** It is expected that cache keys are non-adversarial, ie do not share a long common prefix. This is the case for [Script_cache], for which the keys are B58-encoded contract hashes. diff --git a/src/proto_alpha/lib_benchmarks_proto/carbonated_map_benchmarks.ml b/src/proto_alpha/lib_benchmarks_proto/carbonated_map_benchmarks.ml index 7ba9be0c35d2..f1862d9c4106 100644 --- a/src/proto_alpha/lib_benchmarks_proto/carbonated_map_benchmarks.ml +++ b/src/proto_alpha/lib_benchmarks_proto/carbonated_map_benchmarks.ml @@ -49,8 +49,6 @@ module Config_and_workload = struct let generated_code_destination = None - let () = ignore generated_code_destination - let tags = ["carbonated_map"] let workload_encoding = config_encoding @@ -171,8 +169,6 @@ module Make (CS : COMPARABLE_SAMPLER) = struct let generated_code_destination = None - let () = ignore generated_code_destination - let models = [ ( "carbonated_map", @@ -314,8 +310,6 @@ module Make (CS : COMPARABLE_SAMPLER) = struct let generated_code_destination = None - let () = ignore generated_code_destination - let models = [ ( "carbonated_map", diff --git a/src/proto_alpha/lib_benchmarks_proto/encodings_benchmarks.ml b/src/proto_alpha/lib_benchmarks_proto/encodings_benchmarks.ml index db4d87e7b607..a879665d568f 100644 --- a/src/proto_alpha/lib_benchmarks_proto/encodings_benchmarks.ml +++ b/src/proto_alpha/lib_benchmarks_proto/encodings_benchmarks.ml @@ -141,8 +141,6 @@ module Encoding_micheline : Benchmark.S = struct let generated_code_destination = None - let () = ignore generated_code_destination - let micheline_serialization_trace (micheline_node : Alpha_context.Script.node) = match @@ -213,8 +211,6 @@ module Decoding_micheline : Benchmark.S = struct let generated_code_destination = None - let () = ignore generated_code_destination - let micheline_deserialization_trace (micheline_str : string) = match Data_encoding.Binary.of_string diff --git a/src/proto_alpha/lib_benchmarks_proto/global_constants_storage_benchmarks.ml b/src/proto_alpha/lib_benchmarks_proto/global_constants_storage_benchmarks.ml index ec6fbe7add3e..b3f4f8ad6510 100644 --- a/src/proto_alpha/lib_benchmarks_proto/global_constants_storage_benchmarks.ml +++ b/src/proto_alpha/lib_benchmarks_proto/global_constants_storage_benchmarks.ml @@ -300,8 +300,6 @@ module Set_add : Benchmark.S = struct let generated_code_destination = None - let () = ignore generated_code_destination - let tags = ["global_constants"] type config = unit @@ -357,8 +355,6 @@ module Set_elements : Benchmark.S = struct let generated_code_destination = None - let () = ignore generated_code_destination - let tags = ["global_constants"] type config = unit @@ -416,8 +412,6 @@ module Script_expr_hash_of_b58check_opt : Benchmark.S = struct let generated_code_destination = None - let () = ignore generated_code_destination - let tags = ["global_constants"] type config = unit @@ -490,8 +484,6 @@ struct let generated_code_destination = None - let () = ignore generated_code_destination - let tags = ["global_constants"] type config = unit @@ -576,8 +568,6 @@ module Global_constants_storage_expand_models = struct let generated_code_destination = None - let () = ignore generated_code_destination - let tags = ["global_constants"] type config = unit @@ -653,8 +643,6 @@ module Global_constants_storage_expand_models = struct let generated_code_destination = None - let () = ignore generated_code_destination - let tags = ["global_constants"] type config = unit diff --git a/src/proto_alpha/lib_benchmarks_proto/interpreter_benchmarks.ml b/src/proto_alpha/lib_benchmarks_proto/interpreter_benchmarks.ml index 666344a7333b..e9f600aa81fa 100644 --- a/src/proto_alpha/lib_benchmarks_proto/interpreter_benchmarks.ml +++ b/src/proto_alpha/lib_benchmarks_proto/interpreter_benchmarks.ml @@ -276,8 +276,6 @@ let make_benchmark : let generated_code_destination = None - let () = ignore generated_code_destination - let benchmark kinstr_and_stack_sampler ctxt step_constants () = let stack_instr = kinstr_and_stack_sampler () in benchmark_from_kinstr_and_stack @@ -562,8 +560,6 @@ let make_continuation_benchmark : let generated_code_destination = None - let () = ignore generated_code_destination - let benchmark cont_and_stack_sampler ctxt step_constants () = let stack_instr = cont_and_stack_sampler () in benchmark_from_continuation ?amplification ctxt step_constants stack_instr @@ -663,8 +659,6 @@ module Registration_section = struct let generated_code_destination = None - let () = ignore generated_code_destination - let tags = [Tags.interpreter] type config = {max_iterations : int} @@ -2738,8 +2732,6 @@ module Registration_section = struct let generated_code_destination = None - let () = ignore generated_code_destination - include Default_config include Default_boilerplate diff --git a/src/proto_alpha/lib_benchmarks_proto/sapling_benchmarks.ml b/src/proto_alpha/lib_benchmarks_proto/sapling_benchmarks.ml index 72afe3842afc..0cdb5406d52d 100644 --- a/src/proto_alpha/lib_benchmarks_proto/sapling_benchmarks.ml +++ b/src/proto_alpha/lib_benchmarks_proto/sapling_benchmarks.ml @@ -42,8 +42,6 @@ module Apply_diff_bench : Benchmark.S = struct let generated_code_destination = None - let () = ignore generated_code_destination - let tags = ["sapling"] let diff_from_tx (tx : Alpha_context.Sapling.transaction) = diff --git a/src/proto_alpha/lib_benchmarks_proto/sc_rollup_benchmarks.ml b/src/proto_alpha/lib_benchmarks_proto/sc_rollup_benchmarks.ml index e8af982a1280..2090e007307c 100644 --- a/src/proto_alpha/lib_benchmarks_proto/sc_rollup_benchmarks.ml +++ b/src/proto_alpha/lib_benchmarks_proto/sc_rollup_benchmarks.ml @@ -292,8 +292,6 @@ module Sc_rollup_verify_output_proof_benchmark = struct let generated_code_destination = None - let () = ignore generated_code_destination - let tags = ["sc_rollup"] type config = { @@ -513,8 +511,6 @@ module Sc_rollup_deserialize_output_proof_benchmark = struct let generated_code_destination = None - let () = ignore generated_code_destination - let tags = ["sc_rollup"] type config = { diff --git a/src/proto_alpha/lib_benchmarks_proto/script_repr_benchmarks.ml b/src/proto_alpha/lib_benchmarks_proto/script_repr_benchmarks.ml index a648c283cdbe..0c57d0d9b523 100644 --- a/src/proto_alpha/lib_benchmarks_proto/script_repr_benchmarks.ml +++ b/src/proto_alpha/lib_benchmarks_proto/script_repr_benchmarks.ml @@ -84,8 +84,6 @@ module Micheline_nodes_benchmark : Benchmark.S = struct let generated_code_destination = None - let () = ignore generated_code_destination - let size_based_model = Model.make ~conv:(function {micheline_nodes} -> (micheline_nodes, ())) @@ -129,8 +127,6 @@ module Script_repr_strip_annotations : Benchmark.S = struct let generated_code_destination = None - let () = ignore generated_code_destination - let strip_annotations_model = Model.( make diff --git a/src/proto_alpha/lib_benchmarks_proto/script_typed_ir_size_benchmarks.ml b/src/proto_alpha/lib_benchmarks_proto/script_typed_ir_size_benchmarks.ml index ca630f0e1147..e97011b1ffd8 100644 --- a/src/proto_alpha/lib_benchmarks_proto/script_typed_ir_size_benchmarks.ml +++ b/src/proto_alpha/lib_benchmarks_proto/script_typed_ir_size_benchmarks.ml @@ -81,8 +81,6 @@ end = struct let generated_code_destination = None - let () = ignore generated_code_destination - let value_size_benchmark rng_state (node : Protocol.Script_repr.expr) (michelson_type : Script_repr.expr) = (* FIXME: cleanup and factorize this code between translator benches and these ones. *) @@ -158,8 +156,6 @@ module Type_size_benchmark : Tezos_benchmark.Benchmark.S = struct let generated_code_destination = None - let () = ignore generated_code_destination - let models = [(model_name, size_based_model (Namespace.basename name))] let type_size_benchmark (Script_typed_ir.Ex_ty ty) = @@ -206,8 +202,6 @@ end = struct let generated_code_destination = None - let () = ignore generated_code_destination - let kinstr_size_benchmark rng_state (expr : Protocol.Script_repr.expr) (stack : Script_repr.expr list) = (* FIXME: cleanup and factorize this code between translator benches and these ones. *) @@ -289,8 +283,6 @@ module Node_size_benchmark : Benchmark.S = struct let generated_code_destination = None - let () = ignore generated_code_destination - let size_based_model = Model.make ~conv:(function {micheline_nodes} -> (micheline_nodes, ())) diff --git a/src/proto_alpha/lib_benchmarks_proto/storage_benchmarks.ml b/src/proto_alpha/lib_benchmarks_proto/storage_benchmarks.ml index 347a8f055976..b1fb282687fe 100644 --- a/src/proto_alpha/lib_benchmarks_proto/storage_benchmarks.ml +++ b/src/proto_alpha/lib_benchmarks_proto/storage_benchmarks.ml @@ -185,8 +185,6 @@ module List_key_values_benchmark = struct let generated_code_destination = None - let () = ignore generated_code_destination - let benchmark rng_state {max_size} () = let wrap m = m >|= Environment.wrap_tzresult in let size = @@ -229,8 +227,6 @@ module List_key_values_benchmark_intercept = struct let generated_code_destination = None - let () = ignore generated_code_destination - let benchmark _rng_state _config () = let ctxt = match Lwt_main.run (default_raw_context ()) with diff --git a/src/proto_alpha/lib_benchmarks_proto/ticket_benchmarks.ml b/src/proto_alpha/lib_benchmarks_proto/ticket_benchmarks.ml index 517702ab1813..7fc129dacae0 100644 --- a/src/proto_alpha/lib_benchmarks_proto/ticket_benchmarks.ml +++ b/src/proto_alpha/lib_benchmarks_proto/ticket_benchmarks.ml @@ -87,8 +87,6 @@ module Compare_ticket_hash_benchmark : Benchmark.S = struct let generated_code_destination = None - let () = ignore generated_code_destination - let compare_model = Model.make ~conv:(fun () -> ()) @@ -144,8 +142,6 @@ module Compare_key_contract_benchmark : Benchmark.S = struct let generated_code_destination = None - let () = ignore generated_code_destination - let compare_model = Model.make ~conv:(fun () -> ()) @@ -208,8 +204,6 @@ module Has_tickets_type_benchmark : Benchmark.S = struct let generated_code_destination = None - let () = ignore generated_code_destination - let make_bench_helper rng_state config () = let open Result_syntax in let* ctxt, _ = Lwt_main.run (Execution_context.make ~rng_state) in @@ -267,8 +261,6 @@ module Collect_tickets_benchmark : Benchmark.S = struct let generated_code_destination = None - let () = ignore generated_code_destination - let make_bench_helper rng_state config () = let open Script_typed_ir in let open Result_syntax in diff --git a/src/proto_alpha/lib_benchmarks_proto/translator_benchmarks.ml b/src/proto_alpha/lib_benchmarks_proto/translator_benchmarks.ml index 729258f1ca48..a1bd650460b8 100644 --- a/src/proto_alpha/lib_benchmarks_proto/translator_benchmarks.ml +++ b/src/proto_alpha/lib_benchmarks_proto/translator_benchmarks.ml @@ -207,8 +207,6 @@ module Typechecking_data : Benchmark.S = struct let generated_code_destination = None - let () = ignore generated_code_destination - let typechecking_data_benchmark rng_state (node : Protocol.Script_repr.expr) (michelson_type : Script_repr.expr) = Lwt_main.run @@ -285,8 +283,6 @@ module Unparsing_data : Benchmark.S = struct let generated_code_destination = None - let () = ignore generated_code_destination - let unparsing_data_benchmark rng_state (node : Protocol.Script_repr.expr) (michelson_type : Protocol.Script_repr.expr) = Lwt_main.run @@ -370,8 +366,6 @@ module Typechecking_code : Benchmark.S = struct let generated_code_destination = None - let () = ignore generated_code_destination - let typechecking_code_benchmark rng_state (node : Protocol.Script_repr.expr) (stack : Script_repr.expr list) = Lwt_main.run @@ -452,8 +446,6 @@ module Unparsing_code : Benchmark.S = struct let generated_code_destination = None - let () = ignore generated_code_destination - let unparsing_code_benchmark rng_state (node : Protocol.Script_repr.expr) (stack : Script_repr.expr list) = Lwt_main.run @@ -587,8 +579,6 @@ module Ty_eq : Benchmark.S = struct let generated_code_destination = None - let () = ignore generated_code_destination - let tags = [Tags.translator] let intercept_var = fv (Format.asprintf "%s_const" (Namespace.basename name)) @@ -738,8 +728,6 @@ module Parse_type_benchmark : Benchmark.S = struct let generated_code_destination = None - let () = ignore generated_code_destination - let make_bench rng_state config () = ( Lwt_main.run (Execution_context.make ~rng_state) >>? fun (ctxt, _) -> let ctxt = Gas_helpers.set_limit ctxt in @@ -796,8 +784,6 @@ module Unparse_type_benchmark : Benchmark.S = struct let generated_code_destination = None - let () = ignore generated_code_destination - let make_bench rng_state config () = ( Lwt_main.run (Execution_context.make ~rng_state) >>? fun (ctxt, _) -> let ctxt = Gas_helpers.set_limit ctxt in -- GitLab From 0420f29a0e0752ca3bb2d1b2f26b50c485d327ac Mon Sep 17 00:00:00 2001 From: Pavlo Khrystenko Date: Tue, 21 Mar 2023 15:21:22 +0100 Subject: [PATCH 4/6] Snoop: display generated_code_destination on the cli --- src/bin_snoop/commands.ml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bin_snoop/commands.ml b/src/bin_snoop/commands.ml index de6d446c64d2..69041934eb5d 100644 --- a/src/bin_snoop/commands.ml +++ b/src/bin_snoop/commands.ml @@ -1413,6 +1413,10 @@ module Display_info_cmd = struct let pp_fancy_benchmark fmt (module B : Benchmark.S) = bold_block fmt "Name" Namespace.pp B.name ; bold_block fmt "Filename" Format.pp_print_string B.module_filename ; + bold_block fmt "Generated code destination" Format.pp_print_string + @@ Option.value + ~default:"Destination not specified" + B.generated_code_destination ; bold_block fmt "Info" Format.pp_print_string B.info ; bold_block fmt "Tags" pp_tags B.tags ; bold_block fmt "Models" (pp_models ()) B.models -- GitLab From f189f2ffbc016822fd1b0970f6862c9e12d1d98c Mon Sep 17 00:00:00 2001 From: Pavlo Khrystenko Date: Thu, 30 Mar 2023 23:48:12 +0200 Subject: [PATCH 5/6] Snoop: add generated_code_destination for proto/Mumbai benches --- .../lib_benchmarks_proto/cache_benchmarks.ml | 2 ++ .../carbonated_map_benchmarks.ml | 8 ++++++++ .../lib_benchmarks_proto/encodings_benchmarks.ml | 6 ++++++ .../global_constants_storage_benchmarks.ml | 12 ++++++++++++ .../interpreter_benchmarks.ml | 8 ++++++++ .../lib_benchmarks_proto/sapling_benchmarks.ml | 2 ++ .../lib_benchmarks_proto/sc_rollup_benchmarks.ml | 4 ++++ .../script_repr_benchmarks.ml | 4 ++++ .../script_typed_ir_size_benchmarks.ml | 8 ++++++++ .../lib_benchmarks_proto/skip_list_benchmarks.ml | 4 ++++ .../lib_benchmarks_proto/storage_benchmarks.ml | 2 ++ .../lib_benchmarks_proto/ticket_benchmarks.ml | 8 ++++++++ .../translator_benchmarks.ml | 16 ++++++++++++++++ .../lib_benchmarks_proto/tx_rollup_benchmarks.ml | 6 ++++++ 14 files changed, 90 insertions(+) diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/cache_benchmarks.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/cache_benchmarks.ml index cda89ebf7ca5..be05760b2fc2 100644 --- a/src/proto_016_PtMumbai/lib_benchmarks_proto/cache_benchmarks.ml +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/cache_benchmarks.ml @@ -135,6 +135,8 @@ module Cache_update_benchmark : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + (** It is expected that cache keys are non-adversarial, ie do not share a long common prefix. This is the case for [Script_cache], for which the keys are B58-encoded contract hashes. diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/carbonated_map_benchmarks.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/carbonated_map_benchmarks.ml index 3e6c36d66624..5ccfedba2107 100644 --- a/src/proto_016_PtMumbai/lib_benchmarks_proto/carbonated_map_benchmarks.ml +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/carbonated_map_benchmarks.ml @@ -88,6 +88,8 @@ module Fold_benchmark : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let fold_model = Model.make ~conv:(fun {size} -> (size, ())) @@ -174,6 +176,8 @@ module Make (CS : COMPARABLE_SAMPLER) = struct let module_filename = __FILE__ + let generated_code_destination = None + let models = [ ( "carbonated_map", @@ -212,6 +216,8 @@ module Make (CS : COMPARABLE_SAMPLER) = struct let module_filename = __FILE__ + let generated_code_destination = None + (** Given the cost of comparing keys, the model is used for deducing [intercept] and [traverse_overhead] from: @@ -314,6 +320,8 @@ module Make (CS : COMPARABLE_SAMPLER) = struct let module_filename = __FILE__ + let generated_code_destination = None + let models = [ ( "carbonated_map", diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/encodings_benchmarks.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/encodings_benchmarks.ml index 5e19e2df56a2..7e4960651df4 100644 --- a/src/proto_016_PtMumbai/lib_benchmarks_proto/encodings_benchmarks.ml +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/encodings_benchmarks.ml @@ -131,6 +131,8 @@ module Encoding_micheline : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let micheline_serialization_trace (micheline_node : Alpha_context.Script.node) = match @@ -199,6 +201,8 @@ module Decoding_micheline : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let micheline_deserialization_trace (micheline_str : string) = match Data_encoding.Binary.of_string @@ -264,6 +268,8 @@ let () = Registration_helpers.register (module Decoding_micheline) module Encodings = Tezos_shell_benchmarks.Encoding_benchmarks_helpers.Make (struct let file = __FILE__ + + let generated_code_destination = None end) module Timestamp = struct diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/global_constants_storage_benchmarks.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/global_constants_storage_benchmarks.ml index b32a7eefce51..39318450640a 100644 --- a/src/proto_016_PtMumbai/lib_benchmarks_proto/global_constants_storage_benchmarks.ml +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/global_constants_storage_benchmarks.ml @@ -298,6 +298,8 @@ module Set_add : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let tags = ["global_constants"] type config = unit @@ -353,6 +355,8 @@ module Set_elements : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let tags = ["global_constants"] type config = unit @@ -410,6 +414,8 @@ module Script_expr_hash_of_b58check_opt : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let tags = ["global_constants"] type config = unit @@ -484,6 +490,8 @@ struct let module_filename = __FILE__ + let generated_code_destination = None + let tags = ["global_constants"] type config = unit @@ -569,6 +577,8 @@ module Global_constants_storage_expand_models = struct let module_filename = __FILE__ + let generated_code_destination = None + let tags = ["global_constants"] type config = unit @@ -645,6 +655,8 @@ module Global_constants_storage_expand_models = struct let module_filename = __FILE__ + let generated_code_destination = None + let tags = ["global_constants"] type config = unit diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/interpreter_benchmarks.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/interpreter_benchmarks.ml index a3c850235db0..4476d4a5c680 100644 --- a/src/proto_016_PtMumbai/lib_benchmarks_proto/interpreter_benchmarks.ml +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/interpreter_benchmarks.ml @@ -263,6 +263,8 @@ let make_benchmark : let module_filename = __FILE__ + let generated_code_destination = None + let models = (* [intercept = true] implies there's a benchmark with [intercept = false]. No need to register the model twice. *) @@ -546,6 +548,8 @@ let make_continuation_benchmark : let module_filename = __FILE__ + let generated_code_destination = None + let tags = tags @ more_tags let models = Interpreter_model.make_model ?amplification (Cont_name name) @@ -653,6 +657,8 @@ module Registration_section = struct let module_filename = __FILE__ + let generated_code_destination = None + let tags = [Tags.interpreter] type config = {max_iterations : int} @@ -2704,6 +2710,8 @@ module Registration_section = struct let module_filename = __FILE__ + let generated_code_destination = None + include Default_config include Default_boilerplate diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/sapling_benchmarks.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/sapling_benchmarks.ml index 63955d43b65d..0cdb5406d52d 100644 --- a/src/proto_016_PtMumbai/lib_benchmarks_proto/sapling_benchmarks.ml +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/sapling_benchmarks.ml @@ -40,6 +40,8 @@ module Apply_diff_bench : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let tags = ["sapling"] let diff_from_tx (tx : Alpha_context.Sapling.transaction) = diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/sc_rollup_benchmarks.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/sc_rollup_benchmarks.ml index 790ffda4a01b..7d153ba36fab 100644 --- a/src/proto_016_PtMumbai/lib_benchmarks_proto/sc_rollup_benchmarks.ml +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/sc_rollup_benchmarks.ml @@ -290,6 +290,8 @@ module Sc_rollup_verify_output_proof_benchmark = struct let module_filename = __FILE__ + let generated_code_destination = None + let tags = ["sc_rollup"] type config = { @@ -507,6 +509,8 @@ module Sc_rollup_deserialize_output_proof_benchmark = struct let module_filename = __FILE__ + let generated_code_destination = None + let tags = ["sc_rollup"] type config = { diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/script_repr_benchmarks.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/script_repr_benchmarks.ml index 3823502d4ee2..7399064deba4 100644 --- a/src/proto_016_PtMumbai/lib_benchmarks_proto/script_repr_benchmarks.ml +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/script_repr_benchmarks.ml @@ -82,6 +82,8 @@ module Micheline_nodes_benchmark : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let size_based_model = Model.make ~conv:(function {micheline_nodes} -> (micheline_nodes, ())) @@ -128,6 +130,8 @@ module Script_repr_strip_annotations : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let strip_annotations_model = Model.( make diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/script_typed_ir_size_benchmarks.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/script_typed_ir_size_benchmarks.ml index f21095fe7411..2f98ce0eeabb 100644 --- a/src/proto_016_PtMumbai/lib_benchmarks_proto/script_typed_ir_size_benchmarks.ml +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/script_typed_ir_size_benchmarks.ml @@ -79,6 +79,8 @@ end = struct let module_filename = __FILE__ + let generated_code_destination = None + let value_size_benchmark rng_state (node : Protocol.Script_repr.expr) (michelson_type : Script_repr.expr) = (* FIXME: cleanup and factorize this code between translator benches and these ones. *) @@ -152,6 +154,8 @@ module Type_size_benchmark : Tezos_benchmark.Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let models = [(model_name, size_based_model (Namespace.basename name))] let type_size_benchmark (Script_typed_ir.Ex_ty ty) = @@ -196,6 +200,8 @@ end = struct let module_filename = __FILE__ + let generated_code_destination = None + let kinstr_size_benchmark rng_state (expr : Protocol.Script_repr.expr) (stack : Script_repr.expr list) = (* FIXME: cleanup and factorize this code between translator benches and these ones. *) @@ -275,6 +281,8 @@ module Node_size_benchmark : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let size_based_model = Model.make ~conv:(function {micheline_nodes} -> (micheline_nodes, ())) diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/skip_list_benchmarks.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/skip_list_benchmarks.ml index 3be54fc0b014..af4ac9ce70f0 100644 --- a/src/proto_016_PtMumbai/lib_benchmarks_proto/skip_list_benchmarks.ml +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/skip_list_benchmarks.ml @@ -47,6 +47,8 @@ module Next : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let tags = ["skip_list"] type config = {max_items : int} @@ -101,6 +103,8 @@ module Hash_cell = struct let module_filename = __FILE__ + let generated_code_destination = None + let tags = ["skip_list"] include Skip_list diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/storage_benchmarks.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/storage_benchmarks.ml index 0f85b7714aad..8b0531848ce2 100644 --- a/src/proto_016_PtMumbai/lib_benchmarks_proto/storage_benchmarks.ml +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/storage_benchmarks.ml @@ -147,6 +147,8 @@ module List_key_values_benchmark_boilerplate = struct let module_filename = __FILE__ + let generated_code_destination = None + let config_encoding = let open Data_encoding in conv diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/ticket_benchmarks.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/ticket_benchmarks.ml index 521038eec8c9..908f6eff1289 100644 --- a/src/proto_016_PtMumbai/lib_benchmarks_proto/ticket_benchmarks.ml +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/ticket_benchmarks.ml @@ -83,6 +83,8 @@ module Compare_ticket_hash_benchmark : Benchmark.S = struct let info = "Compare cost for Ticket_hash" + let generated_code_destination = None + let module_filename = __FILE__ let compare_model = @@ -143,6 +145,8 @@ module Compare_key_contract_benchmark : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let compare_model = Model.make ~conv:(fun () -> ()) @@ -208,6 +212,8 @@ module Has_tickets_type_benchmark : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let make_bench_helper rng_state config () = let open Result_syntax in let* ctxt, _ = Lwt_main.run (Execution_context.make ~rng_state) in @@ -273,6 +279,8 @@ module Collect_tickets_benchmark : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let make_bench_helper rng_state config () = let open Script_typed_ir in let open Result_syntax in diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/translator_benchmarks.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/translator_benchmarks.ml index 1f5a79acdbb6..6ba2ab1e1afe 100644 --- a/src/proto_016_PtMumbai/lib_benchmarks_proto/translator_benchmarks.ml +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/translator_benchmarks.ml @@ -197,6 +197,8 @@ module Typechecking_data : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let typechecking_data_benchmark rng_state (node : Protocol.Script_repr.expr) (michelson_type : Script_repr.expr) = Lwt_main.run @@ -271,6 +273,8 @@ module Unparsing_data : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let unparsing_data_benchmark rng_state (node : Protocol.Script_repr.expr) (michelson_type : Protocol.Script_repr.expr) = Lwt_main.run @@ -352,6 +356,8 @@ module Typechecking_code : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let typechecking_code_benchmark rng_state (node : Protocol.Script_repr.expr) (stack : Script_repr.expr list) = Lwt_main.run @@ -430,6 +436,8 @@ module Unparsing_code : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let unparsing_code_benchmark rng_state (node : Protocol.Script_repr.expr) (stack : Script_repr.expr list) = Lwt_main.run @@ -512,6 +520,8 @@ let check_printable_benchmark = let open Tezos_shell_benchmarks.Encoding_benchmarks_helpers in let open Tezos_shell_benchmarks.Encoding_benchmarks_helpers.Make (struct let file = __FILE__ + + let generated_code_destination = None end) in linear_shared ~name:"CHECK_PRINTABLE" @@ -563,6 +573,8 @@ module Ty_eq : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let tags = [Tags.translator] let intercept_var = fv (Format.asprintf "%s_const" (Namespace.basename name)) @@ -721,6 +733,8 @@ module Parse_type_benchmark : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let make_bench rng_state config () = ( Lwt_main.run (Execution_context.make ~rng_state) >>? fun (ctxt, _) -> let ctxt = Gas_helpers.set_limit ctxt in @@ -775,6 +789,8 @@ module Unparse_type_benchmark : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let make_bench rng_state config () = ( Lwt_main.run (Execution_context.make ~rng_state) >>? fun (ctxt, _) -> let ctxt = Gas_helpers.set_limit ctxt in diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/tx_rollup_benchmarks.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/tx_rollup_benchmarks.ml index 04ce5cba93db..db0e4f6beb08 100644 --- a/src/proto_016_PtMumbai/lib_benchmarks_proto/tx_rollup_benchmarks.ml +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/tx_rollup_benchmarks.ml @@ -36,6 +36,8 @@ module Inbox_add_message : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let tags = ["tx_rollup"; "merkle"; "inbox"; "add_message"] type config = {max_messages : int} @@ -120,6 +122,8 @@ module Commitment_full_compact_bench : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let tags = ["tx_rollup"; "merkle"; "commitment"; "compact"] type config = {max_messages : int} @@ -551,6 +555,8 @@ module Verify_proof_compute_bench : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let tags = ["tx_rollup"; "merkle"; "verify"; "proof"] type config = {max_withdrawals : int} -- GitLab From 98c9edde9b174a5eea47a97b7ea69b23463a4bab Mon Sep 17 00:00:00 2001 From: Pavlo Khrystenko Date: Thu, 30 Mar 2023 23:51:38 +0200 Subject: [PATCH 6/6] Snoop: add generated_code_destination for proto/Lima benches --- .../lib_benchmarks_proto/cache_benchmarks.ml | 2 ++ .../carbonated_map_benchmarks.ml | 8 ++++++++ .../lib_benchmarks_proto/encodings_benchmarks.ml | 6 ++++++ .../global_constants_storage_benchmarks.ml | 12 ++++++++++++ .../interpreter_benchmarks.ml | 8 ++++++++ .../lib_benchmarks_proto/sapling_benchmarks.ml | 2 ++ .../lib_benchmarks_proto/sc_rollup_benchmarks.ml | 4 ++++ .../script_repr_benchmarks.ml | 4 ++++ .../script_typed_ir_size_benchmarks.ml | 8 ++++++++ .../lib_benchmarks_proto/storage_benchmarks.ml | 2 ++ .../lib_benchmarks_proto/ticket_benchmarks.ml | 8 ++++++++ .../translator_benchmarks.ml | 16 ++++++++++++++++ .../lib_benchmarks_proto/tx_rollup_benchmarks.ml | 6 ++++++ 13 files changed, 86 insertions(+) diff --git a/src/proto_015_PtLimaPt/lib_benchmarks_proto/cache_benchmarks.ml b/src/proto_015_PtLimaPt/lib_benchmarks_proto/cache_benchmarks.ml index 91c580f09c19..ea9081f34302 100644 --- a/src/proto_015_PtLimaPt/lib_benchmarks_proto/cache_benchmarks.ml +++ b/src/proto_015_PtLimaPt/lib_benchmarks_proto/cache_benchmarks.ml @@ -133,6 +133,8 @@ module Cache_update_benchmark : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + (** It is expected that cache keys are non-adversarial, ie do not share a long common prefix. This is the case for [Script_cache], for which the keys are B58-encoded contract hashes. diff --git a/src/proto_015_PtLimaPt/lib_benchmarks_proto/carbonated_map_benchmarks.ml b/src/proto_015_PtLimaPt/lib_benchmarks_proto/carbonated_map_benchmarks.ml index 8caf846bb0ec..08be32417e2e 100644 --- a/src/proto_015_PtLimaPt/lib_benchmarks_proto/carbonated_map_benchmarks.ml +++ b/src/proto_015_PtLimaPt/lib_benchmarks_proto/carbonated_map_benchmarks.ml @@ -83,6 +83,8 @@ module Fold_benchmark : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let fold_model = Model.make ~conv:(fun {size} -> (size, ())) @@ -173,6 +175,8 @@ module Make (CS : COMPARABLE_SAMPLER) = struct let module_filename = __FILE__ + let generated_code_destination = None + let models = [ ( "carbonated_map", @@ -215,6 +219,8 @@ module Make (CS : COMPARABLE_SAMPLER) = struct let module_filename = __FILE__ + let generated_code_destination = None + (** Given the cost of comparing keys, the model is used for deducing [intercept] and [traverse_overhead] from: @@ -320,6 +326,8 @@ module Make (CS : COMPARABLE_SAMPLER) = struct let module_filename = __FILE__ + let generated_code_destination = None + let models = [ ( "carbonated_map", diff --git a/src/proto_015_PtLimaPt/lib_benchmarks_proto/encodings_benchmarks.ml b/src/proto_015_PtLimaPt/lib_benchmarks_proto/encodings_benchmarks.ml index fd8dcb25963b..9fdca9f02851 100644 --- a/src/proto_015_PtLimaPt/lib_benchmarks_proto/encodings_benchmarks.ml +++ b/src/proto_015_PtLimaPt/lib_benchmarks_proto/encodings_benchmarks.ml @@ -137,6 +137,8 @@ module Encoding_micheline : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let micheline_serialization_trace (micheline_node : Alpha_context.Script.node) = match @@ -207,6 +209,8 @@ module Decoding_micheline : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let micheline_deserialization_trace (micheline_str : string) = match Data_encoding.Binary.of_string @@ -274,6 +278,8 @@ let () = Registration_helpers.register (module Decoding_micheline) module Encodings = Tezos_shell_benchmarks.Encoding_benchmarks_helpers.Make (struct let file = __FILE__ + + let generated_code_destination = None end) module Timestamp = struct diff --git a/src/proto_015_PtLimaPt/lib_benchmarks_proto/global_constants_storage_benchmarks.ml b/src/proto_015_PtLimaPt/lib_benchmarks_proto/global_constants_storage_benchmarks.ml index 9410f13e0a6d..85f18beb0675 100644 --- a/src/proto_015_PtLimaPt/lib_benchmarks_proto/global_constants_storage_benchmarks.ml +++ b/src/proto_015_PtLimaPt/lib_benchmarks_proto/global_constants_storage_benchmarks.ml @@ -296,6 +296,8 @@ module Set_add : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let tags = ["global_constants"] type config = unit @@ -352,6 +354,8 @@ module Set_elements : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let tags = ["global_constants"] type config = unit @@ -411,6 +415,8 @@ module Script_expr_hash_of_b58check_opt : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let tags = ["global_constants"] type config = unit @@ -483,6 +489,8 @@ struct let module_filename = __FILE__ + let generated_code_destination = None + let tags = ["global_constants"] type config = unit @@ -569,6 +577,8 @@ module Global_constants_storage_expand_models = struct let module_filename = __FILE__ + let generated_code_destination = None + let tags = ["global_constants"] type config = unit @@ -647,6 +657,8 @@ module Global_constants_storage_expand_models = struct let module_filename = __FILE__ + let generated_code_destination = None + let tags = ["global_constants"] type config = unit diff --git a/src/proto_015_PtLimaPt/lib_benchmarks_proto/interpreter_benchmarks.ml b/src/proto_015_PtLimaPt/lib_benchmarks_proto/interpreter_benchmarks.ml index 1931e0462959..bd7bb93ad311 100644 --- a/src/proto_015_PtLimaPt/lib_benchmarks_proto/interpreter_benchmarks.ml +++ b/src/proto_015_PtLimaPt/lib_benchmarks_proto/interpreter_benchmarks.ml @@ -258,6 +258,8 @@ let make_benchmark : let module_filename = __FILE__ + let generated_code_destination = None + let models = (* [intercept = true] implies there's a benchmark with [intercept = false]. No need to register the model twice. *) @@ -545,6 +547,8 @@ let make_continuation_benchmark : let module_filename = __FILE__ + let generated_code_destination = None + let tags = tags @ more_tags let models = @@ -657,6 +661,8 @@ module Registration_section = struct let module_filename = __FILE__ + let generated_code_destination = None + let tags = [Tags.interpreter] type config = {max_iterations : int} @@ -2549,6 +2555,8 @@ module Registration_section = struct let module_filename = __FILE__ + let generated_code_destination = None + include Default_config include Default_boilerplate diff --git a/src/proto_015_PtLimaPt/lib_benchmarks_proto/sapling_benchmarks.ml b/src/proto_015_PtLimaPt/lib_benchmarks_proto/sapling_benchmarks.ml index 767e5861b88a..f8584c8f2eaf 100644 --- a/src/proto_015_PtLimaPt/lib_benchmarks_proto/sapling_benchmarks.ml +++ b/src/proto_015_PtLimaPt/lib_benchmarks_proto/sapling_benchmarks.ml @@ -38,6 +38,8 @@ module Apply_diff_bench : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let tags = ["sapling"] let diff_from_tx (tx : Alpha_context.Sapling.transaction) = diff --git a/src/proto_015_PtLimaPt/lib_benchmarks_proto/sc_rollup_benchmarks.ml b/src/proto_015_PtLimaPt/lib_benchmarks_proto/sc_rollup_benchmarks.ml index c769e534932f..9551cedecb93 100644 --- a/src/proto_015_PtLimaPt/lib_benchmarks_proto/sc_rollup_benchmarks.ml +++ b/src/proto_015_PtLimaPt/lib_benchmarks_proto/sc_rollup_benchmarks.ml @@ -43,6 +43,8 @@ module Sc_rollup_update_num_and_size_of_messages_benchmark = struct let module_filename = __FILE__ + let generated_code_destination = None + let tags = ["scoru"] type config = { @@ -147,6 +149,8 @@ module Sc_rollup_add_external_messages_benchmark = struct let module_filename = __FILE__ + let generated_code_destination = None + let tags = ["scoru"] type config = {max_length : int; max_level : int} diff --git a/src/proto_015_PtLimaPt/lib_benchmarks_proto/script_repr_benchmarks.ml b/src/proto_015_PtLimaPt/lib_benchmarks_proto/script_repr_benchmarks.ml index a68744913e2d..8774fcd39221 100644 --- a/src/proto_015_PtLimaPt/lib_benchmarks_proto/script_repr_benchmarks.ml +++ b/src/proto_015_PtLimaPt/lib_benchmarks_proto/script_repr_benchmarks.ml @@ -80,6 +80,8 @@ module Micheline_nodes_benchmark : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let size_based_model = Model.make ~conv:(function {micheline_nodes} -> (micheline_nodes, ())) @@ -121,6 +123,8 @@ module Script_repr_strip_annotations : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let strip_annotations_model = Model.( make diff --git a/src/proto_015_PtLimaPt/lib_benchmarks_proto/script_typed_ir_size_benchmarks.ml b/src/proto_015_PtLimaPt/lib_benchmarks_proto/script_typed_ir_size_benchmarks.ml index 5199ed85e765..58a9095280e1 100644 --- a/src/proto_015_PtLimaPt/lib_benchmarks_proto/script_typed_ir_size_benchmarks.ml +++ b/src/proto_015_PtLimaPt/lib_benchmarks_proto/script_typed_ir_size_benchmarks.ml @@ -81,6 +81,8 @@ end = struct let module_filename = __FILE__ + let generated_code_destination = None + let value_size_benchmark rng_state (node : Protocol.Script_repr.expr) (michelson_type : Script_repr.expr) = (* FIXME: cleanup and factorize this code between translator benches and these ones. *) @@ -156,6 +158,8 @@ module Type_size_benchmark : Tezos_benchmark.Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let models = [(model_name, size_based_model name)] let type_size_benchmark (Script_typed_ir.Ex_ty ty) = @@ -202,6 +206,8 @@ end = struct let module_filename = __FILE__ + let generated_code_destination = None + let kinstr_size_benchmark rng_state (expr : Protocol.Script_repr.expr) (stack : Script_repr.expr list) = (* FIXME: cleanup and factorize this code between translator benches and these ones. *) @@ -283,6 +289,8 @@ module Node_size_benchmark : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let size_based_model = Model.make ~conv:(function {micheline_nodes} -> (micheline_nodes, ())) diff --git a/src/proto_015_PtLimaPt/lib_benchmarks_proto/storage_benchmarks.ml b/src/proto_015_PtLimaPt/lib_benchmarks_proto/storage_benchmarks.ml index 64a07a303a78..b91bf5ee94d6 100644 --- a/src/proto_015_PtLimaPt/lib_benchmarks_proto/storage_benchmarks.ml +++ b/src/proto_015_PtLimaPt/lib_benchmarks_proto/storage_benchmarks.ml @@ -145,6 +145,8 @@ module List_key_values_benchmark_boilerplate = struct let module_filename = __FILE__ + let generated_code_destination = None + let config_encoding = let open Data_encoding in conv diff --git a/src/proto_015_PtLimaPt/lib_benchmarks_proto/ticket_benchmarks.ml b/src/proto_015_PtLimaPt/lib_benchmarks_proto/ticket_benchmarks.ml index 27fc7edd42b1..2918169fd815 100644 --- a/src/proto_015_PtLimaPt/lib_benchmarks_proto/ticket_benchmarks.ml +++ b/src/proto_015_PtLimaPt/lib_benchmarks_proto/ticket_benchmarks.ml @@ -83,6 +83,8 @@ module Compare_ticket_hash_benchmark : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let compare_model = Model.make ~conv:(fun () -> ()) @@ -141,6 +143,8 @@ module Compare_key_contract_benchmark : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let compare_model = Model.make ~conv:(fun () -> ()) @@ -206,6 +210,8 @@ module Has_tickets_type_benchmark : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let make_bench_helper rng_state config () = let open Result_syntax in let* ctxt, _ = Lwt_main.run (Execution_context.make ~rng_state) in @@ -268,6 +274,8 @@ module Collect_tickets_benchmark : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let make_bench_helper rng_state config () = let open Script_typed_ir in let open Result_syntax in diff --git a/src/proto_015_PtLimaPt/lib_benchmarks_proto/translator_benchmarks.ml b/src/proto_015_PtLimaPt/lib_benchmarks_proto/translator_benchmarks.ml index 55de65841f1f..a248a29b4b8c 100644 --- a/src/proto_015_PtLimaPt/lib_benchmarks_proto/translator_benchmarks.ml +++ b/src/proto_015_PtLimaPt/lib_benchmarks_proto/translator_benchmarks.ml @@ -195,6 +195,8 @@ module Typechecking_data : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let typechecking_data_benchmark rng_state (node : Protocol.Script_repr.expr) (michelson_type : Script_repr.expr) = Lwt_main.run @@ -271,6 +273,8 @@ module Unparsing_data : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let unparsing_data_benchmark rng_state (node : Protocol.Script_repr.expr) (michelson_type : Protocol.Script_repr.expr) = Lwt_main.run @@ -354,6 +358,8 @@ module Typechecking_code : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let typechecking_code_benchmark rng_state (node : Protocol.Script_repr.expr) (stack : Script_repr.expr list) = Lwt_main.run @@ -434,6 +440,8 @@ module Unparsing_code : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let unparsing_code_benchmark rng_state (node : Protocol.Script_repr.expr) (stack : Script_repr.expr list) = Lwt_main.run @@ -518,6 +526,8 @@ let check_printable_benchmark = let open Tezos_shell_benchmarks.Encoding_benchmarks_helpers in let open Tezos_shell_benchmarks.Encoding_benchmarks_helpers.Make (struct let file = __FILE__ + + let generated_code_destination = None end) in linear_shared ~name:"CHECK_PRINTABLE" @@ -569,6 +579,8 @@ module Ty_eq : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let tags = [Tags.translator] let intercept_var = Free_variable.of_string (Format.asprintf "%s_const" name) @@ -726,6 +738,8 @@ module Parse_type_benchmark : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let make_bench rng_state config () = ( Lwt_main.run (Execution_context.make ~rng_state) >>? fun (ctxt, _) -> let ctxt = Gas_helpers.set_limit ctxt in @@ -782,6 +796,8 @@ module Unparse_type_benchmark : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let make_bench rng_state config () = ( Lwt_main.run (Execution_context.make ~rng_state) >>? fun (ctxt, _) -> let ctxt = Gas_helpers.set_limit ctxt in diff --git a/src/proto_015_PtLimaPt/lib_benchmarks_proto/tx_rollup_benchmarks.ml b/src/proto_015_PtLimaPt/lib_benchmarks_proto/tx_rollup_benchmarks.ml index 464106d9497d..bfe844a8e335 100644 --- a/src/proto_015_PtLimaPt/lib_benchmarks_proto/tx_rollup_benchmarks.ml +++ b/src/proto_015_PtLimaPt/lib_benchmarks_proto/tx_rollup_benchmarks.ml @@ -34,6 +34,8 @@ module Inbox_add_message : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let tags = ["tx_rollup"; "merkle"; "inbox"; "add_message"] type config = {max_messages : int} @@ -124,6 +126,8 @@ module Commitment_full_compact_bench : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let tags = ["tx_rollup"; "merkle"; "commitment"; "compact"] type config = {max_messages : int} @@ -558,6 +562,8 @@ module Verify_proof_compute_bench : Benchmark.S = struct let module_filename = __FILE__ + let generated_code_destination = None + let tags = ["tx_rollup"; "merkle"; "verify"; "proof"] type config = {max_withdrawals : int} -- GitLab