Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

Commit

Permalink
✍️ add execution option
Browse files Browse the repository at this point in the history
  • Loading branch information
EvolveArt committed Jul 31, 2023
1 parent 9972b98 commit 927696c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion scripts/benchmarking.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ BINARY="./target/release/madara"
STEPS=50
REPEAT=20

# Add a default execution parameter
EXECUTION="wasm"

if [[ ! -f "${BINARY}" ]]; then
echo "binary '${BINARY}' does not exist."
echo "ensure that the madara binary is compiled with '--features=runtime-benchmarks' and in release mode."
Expand Down Expand Up @@ -54,7 +57,7 @@ function bench {
fi

WASMTIME_BACKTRACE_DETAILS=1 ${BINARY} benchmark pallet \
--execution=native \
--execution=${EXECUTION} \
--wasm-execution=compiled \
--pallet "${1}" \
--extrinsic "${2}" \
Expand All @@ -79,6 +82,11 @@ else
ALL=1
fi

if [[ "${@}" =~ "--execution=" ]]; then
EXECUTION=$(echo ${@} | awk -F '--execution=' '{print $2}' | awk '{print $1}')
set -o noglob && set -- ${@/'--execution='${EXECUTION}} && set +o noglob
fi

if [[ "${ALL}" -eq 1 ]]; then
mkdir -p weights/
bench '*' '*' "${CHECK}" "./weights"
Expand Down

0 comments on commit 927696c

Please sign in to comment.