perf(P1): 批量插入性能悬崖 — insert 循环内逐行 prefetchKeys(每行 await drainChain 排空后台链),compaction 在链上数秒时每行阻塞数秒 → kv 后端 10 万行插入 353s;改为批级预加载本批 PK 一次,实测 353s→12.5s(28 倍)/ opfs 25s;新增 kv/opfs 双后端 10 万行回归(性能护栏+索引完整+崩溃恢复),aria-cache 测试同步适配显式 flush
CI / test (18.x) (push) Successful in 18m51s
CI / test (20.x) (push) Successful in 17m42s
CI / test (22.x) (push) Successful in 16m58s
CI / test (24.x) (push) Failing after 14m38s
CI / e2e (push) Successful in 10m36s

This commit is contained in:
thzxx
2026-08-10 20:14:57 +08:00
parent 34225a86b3
commit d83910832e
4 changed files with 97 additions and 1 deletions
+7
View File
@@ -39,6 +39,13 @@ All notable changes to MetonaSqlark will be documented in this file.
(返回空而非报错,与其余方法不一致)。统一 ensureOpen
- **测试盲区** — 快照损坏测试此前篡改未生效(close 后介质不可读),从未真正覆盖损坏路径;
修复并新增 metaSeq 超前回归测试
- **批量插入性能悬崖(P1)** — insert 循环内逐行 `lsm.prefetchKeys([key])`
每行 `await drainChain()` 排空后台链:后台 compaction 在链上数秒时每行阻塞数秒 →
10 万级插入从 ~5ms/批暴跌到 8~11s/批(kv 后端 10 万行共 353s)。
修复:批级预加载本批全部 PK(一次 drainChain),循环内 `lsm.get`
memtable/flush 产物(自动入缓存)兜底,完整性与批量语义不变。
实测:kv 后端 10 万行 **353s → 12.5s**28 倍),opfs 后端 25s
新增 kv/opfs 双后端 10 万行回归(性能护栏 + 索引完整 + 崩溃恢复)
### Added