Commit 9fc6f5e3 authored by Etienne Renault's avatar Etienne Renault

benchs: fancyfies script

* benchs/run-benchmark.sh: Here.
parent 7c0256f1
Pipeline #16346 passed with stage
in 1 minute and 54 seconds
......@@ -46,12 +46,17 @@ OUTPUT=benchs.csv
OUTPUT_BB=benchs-bb.csv
GOCACHE=$(go env | grep CACHE | sed 's/GOCACHE="//g' | sed 's/"//g')
echo "##################################"
echo "==> Benchmark for Compilation time"
echo "##################################"
echo
echo "#filename,loc,transpile_time,compile_time,total_time,final_num_var,final_loc" > $OUTPUT
for model in $FILES; do
echo "==> Processing $model"
echo -e "==> Processing $model"
loc=$(wc -l $model| awk '{print $1}')
echo " - Line of code (original file):\t$loc"
echo -e " - Line of code (original file):\t$loc"
filename=$(basename -- "$model")
filename="${filename%.*}"
......@@ -63,23 +68,23 @@ for model in $FILES; do
../go2pins -f -o $filename -rers "$rers_inputs" $model > /dev/null 2>&1
end=$(date +%s.%N)
transpile_time=$(python -c "print ('%.3f' % (${end} - ${start}))")
echo " - Go2Pins processing:\t\t$transpile_time seconds"
echo -e " - Go2Pins processing:\t\t$transpile_time seconds"
rm -Rf $COCACHE
start=$(date +%s.%N)
make -C $filename > /dev/null2>&1
make -C $filename > /dev/null 2>&1
end=$(date +%s.%N)
compile_time=$(python -c "print ('%.3f' % (${end} - ${start}))")
echo " - Compiling output:\t\t\t$compile_time seconds"
echo -e " - Compiling output:\t\t\t$compile_time seconds"
total_time=`echo "$compile_time + $transpile_time"| bc`
echo " - Total Time:\t\t\t$total_time seconds"
total_time=`echo -e "$compile_time + $transpile_time"| bc`
echo -e " - Total Time:\t\t\t$total_time seconds"
final_num_var=$($filename/go2pins-mc --list-variables | grep '\-' | wc -l)
echo " - Number of variables:\t\t$final_num_var"
echo -e " - Number of variables:\t\t$final_num_var"
loc2=$(wc -l $filename/$filename.go| tail -n1|awk '{print $1}')
echo " - Line of code generated:\t\t$loc2"
echo -e " - Line of code generated:\t\t$loc2"
echo
echo "$filename,$loc,$transpile_time,$compile_time,$total_time,$final_num_var,$loc2" >> $OUTPUT
done
......@@ -92,8 +97,9 @@ echo file : $(pwd)/$OUTPUT contains the CSV of all previous values
NB_FUN=$(cat sqrt_prime_fibo.go | grep compute_main | grep -v func | wc -l)
echo
echo "###########################"
echo "==> Benchmark for BlackBox."
echo "###########################"
echo
echo "/!\ Note that some of these tests require huge amount of memory /!\ "
echo
......@@ -113,8 +119,8 @@ for i in 90 80 70 60 50 40 30 20 10 0; do
RESULT=$(./go2pins-mc -kripke-size| sed "s/kripke/$PERCENT/g" | grep "^#")
ST=$(echo $RESULT | awk -F',' '{print $2}')
TR=$(echo $RESULT | awk -F',' '{print $3}')
echo " - States: $ST states"
echo " - Transitions: $TR transitions"
echo -e " - States: $ST states"
echo -e " - Transitions: $TR transitions"
echo
cd ..
echo $RESULT >> $OUTPUT_BB
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment