Skip to content

Benchmark: add default benchmark parameters, nsamples and bench_num

Context

The same default options for octez-snoop benchmark (specifically, --nsamples=3000, --bench-num=300) are used for all benchmarks currently. But the proper default options differ in some cases, for example, the timer latency and intercept cases.

Major Changes

  • Add type iterations = {nsamples: int; bench_number: int} and val default_iterations : iterations to Benchmark module
  • Set default_iterations to each benchmark
    • Set {nsamples=10000; bench_number=1} to the time latency, {nsamples=3000; bench_number=1} to intercept cases, and {nsamples=3000; bench_number=300} to the other benchmarks
    • If options are given, override them and use their values
  • Add a printing of iterations when executing octez-snoop benchmark such as below
    • Measure.pp_options prints them as nsamples/bench and bench # whereas my printer prints iterations as nsamples and bench_number.
      • It is better to unify the names but to which?
Benchmarking with the following options:
{ options = { seed=None;
              bench #=None;
              nsamples/bench=100;
              minor_heap_size=None;
              config directory=None };
   save_file = ./works/sha3;
   storage = Mem }
Iterations:
{ "nsamples": 3000, "bench_number": 100 }
Using default configuration ..

Fixes: #5015, Related: #5920

Manually testing the MR

Execute octez-snoop benchmark with or without options --bench-num and --nsamples and check its output

Checklist

  • Document the interface of any function added or modified (see the coding guidelines)
  • Document any change to the user interface, including configuration parameters (see node configuration)
  • Provide automatic testing (see the testing guide).
  • For new features and bug fixes, add an item in the appropriate changelog (docs/protocols/alpha.rst for the protocol and the environment, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR
Edited by taiseiKMC

Merge request reports