perf(librarysnapshot): 盘点改用 LoadManifest,去掉按版本重算 blob
build / build (push) Successful in 1m18s

实测:Load 单版 252ms、遍历 79 版 13.8s(2.77GB),这是 overview/storage 超时根因;
不是锁也不是连接池(Open 0ms,无 flock)。

- 新增 LoadManifest:只校验清单摘要与结构;同步/恢复仍走 Load 全量校验。
- ContentUsage 改用 LoadManifest。
- 已知未修完:两个接口仍 503,还有枚举调用点用 Load,待逐个替换。
This commit is contained in:
姚章浩
2026-10-28 21:08:47 +08:00
parent d1dbb2b945
commit 1609a0c9be
3 changed files with 58 additions and 1 deletions
+2 -1
View File
@@ -132,7 +132,8 @@ func (a *Archive) ContentUsage() (ContentUsage, error) {
}
referenced := map[string]int64{}
for _, id := range ids {
m, err := a.Load(id)
// 盘点只读清单:逐版重算 blob 会把一次统计放大到全部版本字节(实测 13.8s)。
m, err := a.LoadManifest(id)
if err != nil {
return usage, err
}