Reuse owned table entry views during recovery encoding

This commit is contained in:
2026-11-10 14:45:18 +08:00
parent 6b3986f89f
commit 104ef3942f
5 changed files with 43 additions and 6 deletions
+8
View File
@@ -847,3 +847,11 @@ hang a second metrics read. Browser cleanup escalates only the fixture's own
process after its exit grace period. Optional heap/receipt sampling and a pinned
baseline override affect only fixture copies and are diagnostic, not product APIs
or production performance claims.
Recovery serialization memoizes entry arrays only for core-owned read-only Map
views. The core tracks membership ownership in a WeakSet; the codec's WeakMap
holds frozen pair/array containers per view. Value objects are not frozen by this
step. The existing recursive codec still checks nested mutability and depth, so
mutable values and external Maps are re-read. This is an encoding cache, not a
second state table; recovery JSON order, formats and journal checks remain the
same. Replacing a table gets a new entry view and leaves prior images unchanged.