mirror of
https://github.com/romanz/amodem.git
synced 2026-02-06 08:38:06 +08:00
scripts: add profiling test
This commit is contained in:
15
scripts/profile.sh
Executable file
15
scripts/profile.sh
Executable file
@@ -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
|
||||
Reference in New Issue
Block a user