Terminal feed: on the web, show streaming output at most every 32 ms
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>
This commit is contained in:
@@ -9,3 +9,7 @@ import 'chat_shell_terminal_yield_stub.dart'
|
||||
/// a third of a large burst. Elsewhere it is a zero-length timer.
|
||||
void Function() chatShellYield(void Function() callback) =>
|
||||
impl.chatShellYield(callback);
|
||||
|
||||
/// Whether frames rasterise on the thread that parses output (the web),
|
||||
/// so that drawing fewer of them while output streams lets it parse more.
|
||||
const bool chatShellRasterSharesThread = impl.chatShellRasterSharesThread;
|
||||
|
||||
Reference in New Issue
Block a user