From 52ee71fad168c9a13073881efabe9d2af6dadfdc Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Thu, 19 Feb 2015 14:57:14 +0200 Subject: [PATCH] scripts: add profiling test --- scripts/profile.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 scripts/profile.sh diff --git a/scripts/profile.sh b/scripts/profile.sh new file mode 100755 index 0000000..27e443b --- /dev/null +++ b/scripts/profile.sh @@ -0,0 +1,15 @@ +#!/bin/bash +set -x -u +SRC=`tempfile` +DST=`tempfile` +AUDIO=`tempfile` +dd if=/dev/urandom of=$SRC bs=1kB count=1000 +export BITRATE=80 +time python -m cProfile -o send.prof amodem-cli send -l- -vv -i $SRC -o $AUDIO 2> send.log +echo -e "sort cumtime\nstats" | python -m pstats send.prof > send.prof.txt + +time python -m cProfile -o recv.prof amodem-cli recv -l- -vv -i $AUDIO -o $DST 2> recv.log +echo -e "sort cumtime\nstats" | python -m pstats recv.prof > recv.prof.txt + +diff $SRC $DST || echo "ERROR!" +rm $SRC $DST $AUDIO