-
Notifications
You must be signed in to change notification settings - Fork 3
/
reproduce.sh
53 lines (42 loc) · 1.73 KB
/
reproduce.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/sh
set -e
# how many times to repeat the string
lines=100000
# how many tests to run
samples=100
test="$PWD/bw-test.sh $lines"
echo "setting Xresources to defaults"
xrdb -load /dev/null
echo "disabling lock screen in all possible ways damnit"
gsettings set org.gnome.desktop.lockdown disable-lock-screen true
gsettings set org.gnome.desktop.screensaver lock-enabled false
gsettings set org.gnome.desktop.screensaver lock-delay 86400
xset -dpms
xset s off
xset dpms 0 0 0 && xset s noblank && xset s off
echo "starting test in 3 seconds, switch to a blank workspace"
sleep 3
echo "terminal,time,cpu,memory" >> times-${samples}x${lines}.csv
# gnome-terminal fails because it returns immediately. bad bad.
#
# also, we don't monitor disk I/O. turns out this could matter,
# because some emulators actually write the backlog to disk.
#
# this would need psutil to DTRT.
for terminal in konsole pterm terminator uxterm xfce4-terminal ; do
echo "priming $terminal"
/usr/bin/time $terminal -e "$test" || continue
for i in $(seq $samples); do
/usr/bin/time $terminal -e "$test" 2>> $terminal-time.txt
done
sed -n "/elapsed/{s/^.* 0:\([0-9]*.[0-9]*\)elapsed \([0-9?]*\)%CPU .*avgdata \([0-9]*\)maxresident.*\$/$terminal,\1,\2,\3/;p}" < $terminal-time.txt >> times-${samples}x${lines}.csv
done
# misquoted
for terminal in alacritty mlterm st stterm urxvt; do
echo "priming"
/usr/bin/time $terminal -e $test $lines || continue
for i in $(seq $samples); do
/usr/bin/time $terminal -e $test $lines 2>> $terminal-time.txt
done
sed -n "/elapsed/{s/^.* 0:\([0-9]*.[0-9]*\)elapsed \([0-9?]*\)%CPU .*avgdata \([0-9]*\)maxresident.*\$/$terminal,\1,\2,\3/;p}" < $terminal-time.txt >> times-${samples}x${lines}.csv
done