A plain cell's before-image is a Cell made from the store, so it holds its own input and boxed literal: 256 bytes rather than 240 keeps the estimate within 10% of BenchmarkHistoryFull's measured heap.
- commit
- d1a4ab3aa488ed9a2518a1f2b979d4f71bf11905
- parent
- bcafcef8be8d18977faa0f34f775c9d9c32ad827
- author
- Dami <dami.etoile@gmail.com>
| M | internal/ | 10 | +++++----- |
@@ -12,15 +12,15 @@ const MaxUndoBytes = 256 << 20
1212 // undoBudget is MaxUndoBytes; tests lower it.1313 var undoBudget int64 = MaxUndoBytes1414 15-// Estimated heap held by the parts of a step. A before-image is a shallow16-// copy of a Cell (216 B) plus its map entry and boxed literal; a formula17-// also keeps its parsed tree and reference lists alive, which grow with18-// its text. The constants match the heap measured by the stress15+// Estimated heap held by the parts of a step. A before-image is a Cell16+// (216 B) plus its map entry, its input and boxed literal (a plain cell's17+// are made for it from the store, see store.go); a formula also keeps its18+// parsed tree and reference lists alive, which grow with its text. The constants match the heap measured by the stress1919 // benchmarks (BenchmarkHistoryFull) within about 10%.2020 const (2121 stepBytes = 512 // the step and its empty maps2222 entryBytes = 64 // a map entry: the key and a pointer23- cellBytes = 240 // a copied Cell and its boxed literal23+ cellBytes = 256 // a Cell, its input's header and its boxed literal2424 formulaBytes = 256 // a parsed formula's tree and references, plus perFormulaByte per byte of text2525 perFormulaByte = 162626 chartBytes = 128