| Date: Sun, 3 May 2020 22:37:40 +0200
perf: auto detect seq(1) and jot(1)
makes perf.sh more portable
Diffstat:
M perf.sh | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
--- |
| @@ -3,21 +3,26 @@
set -eu
num=1000000
+seq=seq
+
+if [ -x /usr/bin/jot ]; then
+ seq=jot
+fi
rm -f perf_*.log
-for i in `jot 10`; do
+for i in `$seq 10`; do
/usr/bin/time st -e jot $num 2>>perf_0.log
done
-for i in `jot 10`; do
+for i in `$seq 10`; do
/usr/bin/time st -e ./ptty jot $num 2>>perf_1.log
done
-for i in `jot 10`; do
+for i in `$seq 10`; do
/usr/bin/time st -e ./ptty ./ptty jot $num 2>>perf_2.log
done
-for i in `jot 10`; do
+for i in `$seq 10`; do
/usr/bin/time st -e ./ptty ./ptty ./ptty jot $num 2>>perf_3.log
done |