In the browser a frame rasterises on the thread that parses output, so a
stream drawn at 60 frames a second spends half its time drawing. With
deferShows (the web default) output written less than a gap after the
last show is shown when the gap has passed; output after a quiet spell
(an echo) still shows at once. Natively frames rasterise on their own
thread and written output keeps showing at once. The stream bench
measures the stream without its final 600 ms wait for frame timings.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- On the web a turn yields through a MessageChannel task: a chain of
zero-length timers is clamped to 4 ms each, which left the emulator
idle for a third of a burst.
- Slices are cut to what the measured speed writes in the budget left,
so a turn ends near 6 ms however costly the output is to parse; the
first write takes 4 Ki units to measure.
- Writes no longer notify the view each: the feed shows the emulator's
state once everything queued is written, and while output still waits
after a turn at most every 32 ms, so a flood draws its final state per
frame instead of a frame per turn.
- Stream bench: producer follows a flow window (256 KiB past drawn, 32 KiB
frames, rate by elapsed time), reports time spent parsing, ?show=each
for the old per-write notify; tool/perf/terminal_stream_profile.mjs
prints a CPU profile of one workload.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Emulator (vendored xterm):
- Widths follow glibc wcwidth on generated Unicode 16 tables
(tool/gen_unicode_tables.py); combining marks, variation selectors,
ZWJ sequences, skin tones, flags and Hangul jamo join the previous cell,
stored as interned clusters (CellContent.clusterFlag) and drawn and
copied whole. U+FE0F and flags take two columns, as modern terminals
do; a wide character never starts in the last column.
- Box drawing, block elements and Powerline separators are drawn as
geometry filling the cell; rows are whole pixels high.
- Backgrounds merge per colour; each line is a picture reused until the
line changes (BufferLine.version); a line drawn unchanged settles into
one laid out paragraph with a span per style. TerminalStyle and
TerminalTheme compare by value.
App: bundled Symbols Nerd Font Mono subset (568 KiB, MIT) as the
terminal's first fallback, loaded on first use; line height 1.1;
?terminalUnicode=1 fixture showcase; bench gains a progress workload.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>