44 lines
700 B
Bash
Executable File
44 lines
700 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -eu
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
strans_pid=
|
|
perf_pid=
|
|
|
|
cleanup()
|
|
{
|
|
trap - 0 1 2 15
|
|
if test -n "$perf_pid"; then
|
|
kill -INT "$perf_pid" 2>/dev/null || true
|
|
wait "$perf_pid" 2>/dev/null || true
|
|
fi
|
|
if test -n "$strans_pid"; then
|
|
kill "$strans_pid" 2>/dev/null || true
|
|
wait "$strans_pid" 2>/dev/null || true
|
|
fi
|
|
}
|
|
|
|
trap cleanup 0 1 2 15
|
|
|
|
./strans map font &
|
|
strans_pid=$!
|
|
sleep 1
|
|
kill -0 "$strans_pid"
|
|
|
|
# warm up glyph cache
|
|
./bench/bench bench/bench.keys 100
|
|
echo "cache warmed up"
|
|
|
|
perf record -g -o bench/perf.data -p "$strans_pid" &
|
|
perf_pid=$!
|
|
sleep 1
|
|
kill -0 "$perf_pid"
|
|
|
|
./bench/bench bench/bench.keys 100
|
|
|
|
kill -INT "$perf_pid"
|
|
wait "$perf_pid" 2>/dev/null || true
|
|
perf_pid=
|