Repository navigation
perf(ai): 按业务边界持久化,降低回复与索引进度写盘 - #182
Open
xiaoshengbao wants to merge 2 commits into
Open
xiaoshengbao wants to merge 2 commits into
xiaoshengbao wants to merge 2 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
生成回复时,原逻辑每 80ms 将累计全文写入任务记录、时间线和 SSE 事件;索引读取/计算计数也会反复保存完整任务。2.8 已限制索引事件表增长,但仍存在明显的高频写入与 WAL 回写。本 PR 按业务边界保存状态,同时保留实时展示、暂停、恢复和通知。
行为变化
写入量对照
Windows 隔离测试,对照基线 b02c569;使用 GetProcessIoCounters 测量进程写入量,包含最终保存及连接关闭。回复场景以可控时钟模拟 100 帧、80ms 间隔、最终 5 万中文字符,不是实际模型调用或硬盘物理写入测速。
验证
恢复边界
进程突然退出时,尚未提交的展示片段会回退到最近的草稿检查点;已提交证据、工作流检查点、索引数据/游标和未投递通知仍持久保存。正常终态会保存最新正文。