Skip to content
Snippets Groups Projects
Commit eac9969d authored by Nick Paladino's avatar Nick Paladino
Browse files

Added run_benches.sh file, set executable

parent ddee48f9
No related branches found
No related tags found
1 merge request!815Ready for Review- Examples benchmark script
#!/usr/bin/env bash
set -e -u -o pipefail
EXAMPLES_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
PROJECT_DIR=$(dirname $(cargo locate-project | awk -F\" '{print $4}'))
TIMEFORMAT='%U seconds'
# Some of the examples assume that the working directory is the project root
# and it never hurts to force consistency regardless
cd $PROJECT_DIR
function check_timing {
# Run script and redirect error to /dev/null
utime="$( time ( $PROJECT_DIR/target/release/ion $1 2> /dev/null) 2>&1 1>/dev/null )"
echo $1 $utime
}
# Build release binary
#cargo build --release
set +e
# Iterate over every Ion script in examples directory
for i in $EXAMPLES_DIR/*.ion; do
check_timing $i >> $EXAMPLES_DIR/temp.out;
done
cat $EXAMPLES_DIR/temp.out | column -t;
rm $EXAMPLES_DIR/temp.out;
exit 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment