#!/bin/sh # The cost of spike 3's shared preview on the headless display: CPU and # memory with the main window alone (the preview in it), with the studio's # window open too (one picture in both), and with both windows but no # compositor. Every case writes .jsonl (one line a second, then the # summary) and .load (load average before and after) to $OUT. # # spikes/gpui/shell.sh spikes/gpui/headless.sh -- spikes/gpui/windows/measure.sh [CASE...] # # Cases (default: all): windows-main windows-both windows-none. # SECONDS_RUN (default 45) and WARMUP (default 10) set their length. set -eu root=$(cd "$(dirname "$0")/../../.." && pwd) out=${OUT:-$root/.scratch/gpui-spikes-results} mkdir -p "$out" out=$(cd "$out" && pwd) seconds=${SECONDS_RUN:-45} warmup=${WARMUP:-10} for c in ${*:-windows-main windows-both windows-none}; do case $c in windows-main) args= ;; windows-both) args=--open-studio ;; windows-none) args="--open-studio --no-preview" ;; *) echo "unknown case $c" >&2; exit 2 ;; esac echo "== $c: spike-windows $args" >&2 echo "load before: $(cat /proc/loadavg)" >"$out/$c.load" # shellcheck disable=SC2086 "$root/target/release/spike-windows" $args --seconds "$seconds" --warmup "$warmup" \ --out "$out/$c.jsonl" >/dev/null 2>"$out/$c.log" echo "load after: $(cat /proc/loadavg)" >>"$out/$c.load" tail -1 "$out/$c.jsonl" done