Run benchmark 10 times

This commit is contained in:
Sashko Stubailo
2015-08-31 14:58:36 -07:00
parent be34de5d37
commit 8b13ffb772

View File

@@ -9,7 +9,7 @@ checkout_dir=$(pwd)
app_dir=`mktemp -d /tmp/meteor-bench-app.XXXX`
cd $app_dir
$checkout_dir/meteor create --example todos . &> /dev/null
$checkout_dir/meteor create --example todos . > /dev/null
# Add a file to the app that shuts it down immediately
echo "Meteor.startup(function(){process.exit(0)});" > "exit.js"
@@ -17,18 +17,20 @@ echo "Meteor.startup(function(){process.exit(0)});" > "exit.js"
# Run once to build all of the packages
$checkout_dir/meteor --once &> /dev/null
# Run again to time
/usr/bin/time -p $checkout_dir/meteor --once 1> /dev/null 2> out
for i in `seq 10`; do
# Run again to time
/usr/bin/time -p $checkout_dir/meteor --once 1> /dev/null 2> out
BENCHMARK_OUTPUT=`cat out`
BENCHMARK_OUTPUT=`cat out`
# Get first line
BENCHMARK_OUTPUT=$(echo "$BENCHMARK_OUTPUT" | head -n 1)
ARRAY=($BENCHMARK_OUTPUT)
NUMBER=${ARRAY[1]}
# Get first line
BENCHMARK_OUTPUT=$(echo "$BENCHMARK_OUTPUT" | head -n 1)
ARRAY=($BENCHMARK_OUTPUT)
NUMBER=${ARRAY[1]}
# Print output
echo $NUMBER
# Print output
echo $NUMBER
done
cd $checkout_dir