Skip to content
Snippets Groups Projects
Select Git revision
  • 09e1592f559a88f450bec3be6b04f3596b5e4d3d
  • master default protected
  • tmp
  • refactoWidgetInsteadMethods
  • implementLightnode
  • subscribesSplit
  • hugo_RML16
  • refactorOnboardingSlideshow
  • duniterV1Latest
  • scanNetwork
  • dubp_rs
  • v0.0.12+34
  • v0.0.12+33
  • v0.0.11+32
  • v0.0.11+31
  • v0.0.11+30
  • v0.0.11+28
  • v0.0.10+27
  • v0.0.10+26
  • v0.0.10+25
  • v0.0.9+24
  • v0.0.9+23
  • v0.0.9+20
  • v0.0.9+19
  • v0.0.9+18
  • v0.0.9+17
  • v0.0.9+16
  • v0.0.9+15
  • v0.0.9+14
  • v0.0.9+13
  • v0.0.9+12
31 results

my_wallets.dart

Blame
  • Forked from clients / Ğecko
    Source project has a limited visibility.
    weights-benchmarking.md 3.88 KiB

    Weights benchmarking

    What is the reference machine?

    For now (09/2022), it's a Raspberry Pi 4 Model B - 4GB with an SSD connected via USB3.

    To cross-compile the benchmarks binary for armv7:

    ./scripts/cross-build-arm.sh --features runtime-benchmarks

    The cross compiled binary is generated here: target/armv7-unknown-linux-gnueabihf/release/duniter

    How to benchmarks weights of a Call/Hook/Pallet

    1. Create the benchmarking tests. See commit f5f2ae96 for a complete real example.

    2. Run the benchmark test on your local machine:

    cargo test -p <pallet> --features runtime-benchmarks
    1. If the benchmark tests compiles and pass, compile the binary with benchmarks on your local machine:
    cargo build --release --features runtime-benchmarks
    1. Run the benchmarks on your local machine (to test if it work with a real runtime). See 0d1232cd for a complete real example. The command is:
    duniter benchmark pallet --chain=CHAINSPEC --steps=50 --repeat=20 --pallet=<pallet> --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/common/src/weights/
    1. Use the generated file content to create the WeightInfo trait and the () dummy implementation in pallets/<pallet>/src/weights.rs. Then use the WeightInfo trait in the real code of the pallet. See 62dcc17f for a complete real example.

    2. Redo steps 3. and 4. on the reference machine.

    3. Use the runtime/common/src/weights/pallet_<pallet>.rs generated on the reference machine in the runtimes configuration. See af62a3b9 for a complete real example.

    Note 1: Use relevant chainspec for the benchmarks in place of CHAINSPEC, for example --chain=dev.

    Note 2: If the reference machine does not support wasmtime, you should replace --wasm-execution=compiled by --wasm-execution=interpreted-i-know-what-i-do.

    Generate base block benchmarking

    1. Build binary for reference machine and copy it on reference machine.
    2. Run base block benchmarks command:
    duniter benchmark overhead --chain=dev --execution=wasm --wasm-execution=compiled --weight-path=./runtime/common/src/weights/ --warmup=10 --repeat=100
    1. Commit changes and open an MR.