#!/usr/bin/env bash
set -e
if [ $# -eq 0 ]; then
echo "Please provide the name of an example to profile"
exit 1
fi
# Use debug profile since that is how this library will be used
cargo build --example "$1"
perf stat -e cycles,L1-dcache-load-misses,instructions,cache-misses,context-switches "./target/debug/examples/$1" 2>&1