Files
tty7/scripts/bench/fire.sh
T
l0ng-ai 22e1ab1694 tty7: a GPU-rendered, daemon-backed terminal in pure Rust
tty7 is split into two Rust processes: a persistent daemon that owns the
shells and a GPU-rendered client that talks to it over a local socket.
Because the shells live in the daemon, quitting and reopening the app
leaves the session intact — detach and reattach, no tmux required.

- Persistent sessions — the daemon holds the PTYs and child processes, so
  closing a window or swapping in a new build never takes a shell down.
- Performance — an 11 MB `cat` completes in 95 ms and DOOM-fire renders at
  888 fps; the daemon drains the PTY at device speed off the render path.
- Shell-aware — new tabs and splits open in the current working directory;
  zsh, bash, fish, and PowerShell are set up automatically.
- Enhanced prompt — inline completion, syntax highlighting, history, and
  in-terminal search, with rich flag/subcommand signatures for common tools.
- Tabs, resizable splits, a command palette, click-to-open links, desktop
  notifications, eight themes, and CJK/IME input.

Native builds for macOS, Windows, and Linux.
Built on Zed's gpui and Alacritty's VT core.
2026-07-06 21:54:27 +08:00

42 lines
1.4 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/zsh
# DOOM-fire FPS benchmark. Runs INSIDE the terminal under test as its shell
# (run_one.sh arranges that); $1 names the terminal for the result file.
#
# 5 runs; each lets the fire burn ~14 s, then SIGINTs it. The binary is built
# by setup.sh with doom-fire-fps.patch, which dumps the cumulative average fps
# to $DOOM_FPS_FILE every 30 frames — the file's last value IS the run's
# average, so nothing has to record the output stream. (The obvious
# alternative, script(1), wrote multi-GB recordings on fast terminals and the
# disk writes throttled later runs by 4-8×.) stdout stays the real pty:
# DOOM-fire sizes itself via ioctl(stdout), and stdin may be a pipe — the
# printf feeds the "press return" intro pauses.
SELF=${0:A}
HERE=${SELF:h}
REPO=${HERE:h:h}
WORK=${TTY7_BENCH_DIR:-$REPO/.bench}
T=${1:-unknown}
R=$WORK/results
DOOM=$WORK/DOOM-fire-zig/zig-out/bin/DOOM-fire
mkdir -p $R
out=$R/fire-$T.txt
: > $out
print -- "grid: $(stty size 2>/dev/null)" >> $out
sleep 1
for i in 1 2 3 4 5; do
fpsfile=$WORK/doom-fps-$T-$i.txt
rm -f $fpsfile
( printf '\n\n\n\n\n\n'; sleep 60 ) | DOOM_FPS_FILE=$fpsfile $DOOM &
sp=$!
sleep 15
pkill -INT -f 'zig-out/bin/DOOM-fire' 2>/dev/null
sleep 1
pkill -9 -f 'zig-out/bin/DOOM-fire' 2>/dev/null
wait $sp 2>/dev/null
fps=$(head -1 $fpsfile 2>/dev/null)
print -- "run $i: ${fps:-NA} fps" >> $out
printf '\e[0m\e[2J\e[H'
sleep 1
done
print -- done >> $out
sleep 5