Repository navigation
性能:页面只读快照,远端读取全部放到后台 - #59
Merged
Merged
Conversation
…ground - ui.Fresh answers any kept value at once and reads again behind it (only a first read waits, bounded); old values say their age and pull again in 5 s; snapshots persist in the store (1 MB each) and are dropped with the account. - PersonaToday keeps each of its four parts' last good read; a failed part is reused and marked, not re-read per draw. - Store: WAL + synchronous=NORMAL, reads on a separate read-only connection; Store.changes counts every write (bookkeeping writes opt out), and needs()/counts()/active_groups() are batched and shared per change count. - Feishu: group candidates come from the list the background read publishes, without the adapter's locks. - One watchdog thread per UI logs the threads' stacks when a draw passes 2 s (3 an hour); hourly per-page render stats (count, p50, p95, max). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- 核心:页面先给已有的数据、后台再刷新(老了标「n 分钟前」并 5 秒后拉新),快照存进库里,重启后第一次打开也立刻出;Persona 四块各自沿用上次成功的值。 - 核心:数据库改 WAL,读写分开连接;「需要我」批量查询、按变更计数共用结果。 - 飞书:群列表渲染不再拿适配器的锁;慢渲染(超过 2 秒)记一次线程栈,每小时一行各页面耗时汇总。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
做了什么
页面和卡片渲染一律只读内存快照,任何网络、lark-cli、hub 读都放到后台。
ui.Fresh):只要有值就立刻给,后台再刷新;只有什么都没有时才有界等待。值老了,页面上写「n 分钟前的数据,正在更新」,5 秒后自动拉新。日程、中转站、Agent 进度、Persona 四块、今天页里的微信汇总都接上了。snapshots表(单条上限 1 MB),重启后第一次打开也立刻出上次的内容;换账号时作废。synchronous=NORMAL,读走单独的只读连接,后台大批写入时渲染不再排队;数据库文件(含 -wal、-shm)仍是 0600。性能
本地合成压测(120 个会话、7,800 条消息、远端每次调用延迟 150 ms):
线上经 hub 的对比(含 VPS↔Mac 往返约 280 ms)见上线后的评论。
怎么验证的
bash scripts/test.sh和PYTHON=/usr/bin/python3 bash scripts/test.sh全部通过;新增的回归测试在改动前的代码上都会失败。注意
🤖 Generated with Claude Code