referrerpolicy=no-referrer-when-downgrade

Module v1

Module v1 

Expand description

Legacy v1 benchmarking macros.

Soft-deprecated in favor of v2: write new benchmarks with v2 and migrate existing ones when convenient. See the v2 docs for a migration guide.

This is documentation-only; no #[deprecated] attribute is added, since v1 is still widely used and the warnings would break the -D warnings build. Macros for benchmarking a FRAME runtime.

Modules§

v2
Contains macros, structs, and traits associated with v2 of the pallet benchmarking syntax.

Macros§

add_benchmark
This macro adds pallet benchmarks to a Vec<BenchmarkBatch> object.
benchmarks
Construct pallet benchmarks for weighing dispatchables.
benchmarks_instance
Same as benchmarks but for instantiable module.
benchmarks_instance_pallet
Same as benchmarks but for instantiable pallet declared frame_support::pallet.
define_benchmarks
Defines pallet configs that add_benchmarks and list_benchmarks use. Should be preferred instead of having a repetitive list of configs in add_benchmark and list_benchmark.
impl_benchmark_test_suite
This creates a test suite which runs the module’s benchmarks.
list_benchmark
This macro allows users to easily generate a list of benchmarks for the pallets configured in the runtime.
validate_pov_mode
Validates the passed pov_modes.
whitelist
Whitelist the given account.
whitelist_account

Structs§

Analysis
BenchmarkBatch
The results of a single of benchmark.
BenchmarkBatchSplitResults
Results of a single benchmark, with timing and storage-access measurements kept apart so the analysis layer can apply a different statistical model to each.
BenchmarkConfig
Configuration used to setup and run runtime benchmarks.
BenchmarkList
A list of benchmarks available for a particular pallet and instance.
BenchmarkMetadata
BenchmarkRecording
Records the wall-clock time and proof size of a single benchmark iteration.
BenchmarkResult
Result from running benchmarks on a FRAME pallet. Contains duration of the function call in nanoseconds along with the benchmark parameters used for that benchmark result.

Enums§

AnalysisChoice
BenchmarkError
Possible errors returned from the benchmarking pipeline.
BenchmarkParameter
An alphabet of possible parameters to use for benchmarking.
BenchmarkSelector

Traits§

Benchmark
Runtime api for benchmarking a FRAME runtime.
Benchmarking
The pallet benchmarking trait.
BenchmarkingSetup
The required setup for creating a benchmark.
Recording
Marks the timed region of a single benchmark iteration.

Functions§

account
Grab an account, seeded by a name and index.
add_to_whitelist_child
Helper function to whitelist a child trie storage key.
current_time
Get the number of nanoseconds passed since the UNIX epoch
show_benchmark_debug_info
show error message and debugging info for the case of an error happening during a benchmark
whitelisted_caller
This caller account is automatically whitelisted for DB reads/writes by the benchmarking macro.