benchmarking

package
v0.0.3-rc-1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

type Module struct {
	// contains filtered or unexported fields
}

Module implements API for benchmarking dispatchable extrinsic calls and system hooks. For more information about the benchmarking process, see: /docs/docs/development/benchmarking.md

func New

func New(systemIndex sc.U8, modules []primitives.Module, decoder types.RuntimeDecoder, storage io.Storage, transactionBroker io.TransactionBroker, logger log.RuntimeLogger) Module

func (Module) BenchmarkDispatch

func (m Module) BenchmarkDispatch(dataPtr int32, dataLen int32) int64

BenchmarkDispatch benchmarks the execution of dispatchable calls. It takes two arguments: - dataPtr: Pointer to the data in the Wasm memory. - dataLen: Length of the data. which represent the SCALE-encoded benchmarking configuration.

Executes a dispatch extrinsic call N times in isolated environment by measuring the elapsed time in each execution.

Returns a pointer-size of the SCALE-encoded benchmarking result.

TODO: Implement DbCommit, DbWipe once the state implementation in Gossamer supports caching and nested transactions. https://github.com/ChainSafe/gossamer/discussions/3646

func (Module) BenchmarkHook

func (m Module) BenchmarkHook(dataPtr int32, dataLen int32) int64

BenchmarkHook benchmarks the execution of system hooks. It takes two arguments: - dataPtr: Pointer to the data in the Wasm memory. - dataLen: Length of the data. which represent the SCALE-encoded benchmarking configuration.

Based on the provided system hook, it executes it for each of the preconfigured runtime modules and sums their execution elapsed time.

Returns a pointer-size of the SCALE-encoded benchmarking result.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL