Repository navigation
无状态并行批处理映射(Batch Mapper) #460
yanfei0725
started this conversation in
Ideas
Replies: 1 comment
|
卷卷卷 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
痛点:串行交互的延迟浪费
AI 为了修个 Bug,往往要同时看 a.ts(报错点)、b.ts(调用方)、c.ts(类型定义)。
现在的做法是:AI 连续发起 3 次独立的 read_files 调用。这不仅白白消耗了多轮的交互 Token,而且磁盘 I/O 是串行等待的,极大地拖慢了响应时间(P99 延迟飙升)。
方案:合并为一次并发读取
提供一个支持传入数组的接口(比如 ops_parallel_read)。
· AI 只需要传:["a.ts", "b.ts", "c.ts"]。
· 底层利用 Node.js 原生的 Promise.all 配合一个极简的并发池(比如限制同时最多读 10 个文件,防止把操作系统的文件描述符 FD 耗干)。
· 收益:把 N 次交互降为 1 次,把串行变并行。不仅砍了 Token,还能大幅提升 Agent 干活的体感速度。
All reactions