Skip to content

Commit

Permalink
chore(avm): vm compilation metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyasRidhuan committed Jul 31, 2024
1 parent 19cdf01 commit 0f7e518
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions barretenberg/cpp/scripts/analyze_vm_compile_time.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash
set -eu

PRESET="${1:-wasm-threads}"
TARGET="${2:-barretenberg.wasm}"

BUILD_DIR=build-$PRESET-compiler-profile

cd $(dirname $0)/..

if [ -d $BUILD_DIR ]; then
# Run summary analysis
cd build-$PRESET-compiler-profile
pushd src/barretenberg/vm/CMakeFiles/vm_objects.dir/avm_trace/ > /dev/null 2>&1
# Process vm json profiling files and "simplify" them in a summary
jq -cn 'inputs | .traceEvents | map(select(.name == "Total ExecuteCompiler")) | map({ name: input_filename, "time(ms)": .args."avg ms"})' **/*.cpp.json | jq -s add > avm_compilation_summary.json
popd > /dev/null 2>&1
mv ./src/barretenberg/vm/CMakeFiles/vm_objects.dir/avm_trace/avm_compilation_summary.json .
echo -e "Summary file outputted to $BUILD_DIR/avm_compilation_summary.json"
else
echo -e "\n$BUILD_DIR not found, run $(dirname $0)/analyze_compile_time.sh $PRESET $TARGET before running this script"
fi


0 comments on commit 0f7e518

Please sign in to comment.