Created
November 8, 2015 01:26
-
-
Save OzuYatamutsu/792f0cf542c6ec7c5254 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
NUM_SAMPLES=50 | |
echo "The following runtime deltas are reported in seconds." | |
echo "Collecting $NUM_SAMPLES samples..." | |
# Build project from scratch each time. | |
prepare_build() { | |
make clean | |
make all | |
export LD_LIBRARY_PATH=$(pwd):$LD_LIBRARY_PATH | |
} | |
# Performance run | |
perf_test() { | |
# Time before | |
X0=$(date +%s.%N) | |
# Run test program | |
./pi_integration_test > /dev/null | |
# Time after | |
X1=$(date +%s.%N) | |
# Time delta | |
delta=$(python -c "print($X1 - $X0)") | |
echo $delta | |
} | |
# Repeat NUM_SAMPLES times | |
for (( i=1; i<=$NUM_SAMPLES; i++ )) do | |
prepare_build > /dev/null | |
perf_test | |
done | |
# Clean up when done | |
make clean > /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment