第 1 周 · D2🔒 锁定约 4 小时
不抖的流式渲染:渲染风暴、增量 Markdown 与滚动锚定
模型每秒吐几十上百个增量,最朴素的写法会让 React 每个增量重渲染一次,还会把用户正在打字的输入框拖卡。这一天依次解决渲染风暴、不完整 Markdown、滚动位置被抢三个问题,把流式聊天做到长会话也不抖。
模型每秒吐几十上百个增量,最朴素的写法会让 React 每个增量重渲染一次,还会把用户正在打字的输入框拖卡。这一天依次解决渲染风暴、不完整 Markdown、滚动位置被抢三个问题,把流式聊天做到长会话也不抖。
面试题库
模型每秒吐 80 个增量,你的聊天页开始掉帧、输入框也变卡,你按什么顺序排查和优化?A model is emitting 80 deltas per second, your chat page drops frames, and the input box lags. In what order do you diagnose and fix it?
国内高频海外高频深入#react-performance#streaming#profiling🔒 解锁本章后查看答题要点。
流式 Markdown 渲染到一半,代码块的围栏只来了一半,你的渲染器应该怎么处理?Your streaming Markdown renderer receives a code fence that has opened but not yet closed. How should it handle that?
国内高频海外高频进阶#markdown#streaming#rendering🔒 解锁本章后查看答题要点。
聊天消息列表什么时候该自动滚到底部,什么时候不该?说出你的判定规则。When should a chat message list auto-scroll to the bottom, and when should it not? State your rule.
国内高频海外高频基础#scroll-behavior#ux#chat-ui🔒 解锁本章后查看答题要点。
你的流式聊天在本地怎么测都不卡,一上线用户就抱怨界面卡顿。可能是什么原因?Your streaming chat never janks locally but users report lag in production. What could explain that?
国内高频海外高频深入#react-performance#testing#debugging🔒 解锁本章后查看答题要点。
