Ten million cells of numbers take 205 MB with the compact store. The dense-1Mx10 shape (a million rows of ten numbers) builds, edits, undoes, saves and opens at that size, and BenchmarkMemory reports its heap per cell.
- commit
- bcafcef8be8d18977faa0f34f775c9d9c32ad827
- parent
- ad611c4e4c1f3ee17e61c436356112a9f786f60b
- author
- Dami <dami.etoile@gmail.com>
| M | docs/ | 4 | ++-- |
| M | docs/ | 6 | +++--- |
| M | internal/ | 7 | ++++--- |
| M | internal/ | 6 | +++--- |
| M | internal/ | 2 | ++ |
| M | internal/ | 8 | ++++++++ |
@@ -49,9 +49,9 @@ which kept their range, and undo brings the removed ones back.
4949 5050 **Size.** A sheet is 1,048,576 rows by 16,384 columns (A to XFD), as in5151 Excel. Imports keep at most `max-cells` cells ([Configuration](../reference/config.md#max-cells),52-two million by default, about 600 MB): whole rows, as many as fit, and52+ten million by default, a few hundred MB): whole rows, as many as fit, and5353 the context line says how many rows were left out, e.g. `only the first54-166,666 rows fit in max-cells (2,000,000 cells); 12,000 rows left out`.54+833,333 rows fit in max-cells (10,000,000 cells); 12,000 rows left out`.5555 Data past the grid's edges is left out the same way. WK1 files keep their5656 own 8,192 by 256. See [Bounds of support](../contributing/limits.md#imports) for speeds.5757 @@ -71,7 +71,7 @@ start.
7171 | [`chart-images`](#chart-images) | `true` | `O12_CHART_IMAGES` |7272 | [`notifications`](#notifications) | `true` | `O12_NOTIFICATIONS` |7373 | [`keymap`](#keymap) | `default` | `O12_KEYMAP` |74-| [`max-cells`](#max-cells) | `2000000` | `O12_MAX_CELLS` |74+| [`max-cells`](#max-cells) | `10000000` | `O12_MAX_CELLS` |7575 | [`jev-api-key-command`](#jev-api-key-command) | | |7676 | [`jev-credential-store`](#jev-credential-store) | `true` | `O12_JEV_CREDENTIAL_STORE` |7777 | [`jev-base-url`](#jev-base-url) | | `TYPESAFE_BASE_URL` |@@ -137,12 +137,12 @@ Keys in the grid. `default` works like Google Sheets; `vim` adds hjkl, counts, o
137137 138138 #### `max-cells`139139 140-The most cells an import keeps, and a paste or fill writes at once. A sheet takes about 300 bytes a cell, so the default of two million is about 600 MB. Imports keep whole rows up to the budget and say how many they left out; larger pastes and fills are refused. The grid itself is 1,048,576 rows by 16,384 columns (A to XFD) whatever this is.140+The most cells an import keeps, and a paste or fill writes at once. Numbers and text take 20 to 60 bytes a cell and formulas about 750, so the default of ten million cells of data is 200 to 600 MB. Imports keep whole rows up to the budget and say how many they left out; larger pastes and fills are refused. The grid itself is 1,048,576 rows by 16,384 columns (A to XFD) whatever this is.141141 142142 | | |143143 |---|---|144144 | Type | number |145-| Default | `2000000` |145+| Default | `10000000` |146146 | Environment | `O12_MAX_CELLS` |147147 | Applies | File > Settings > Reload config |148148 @@ -92,9 +92,10 @@ var Options = []Option{
9292 Desc: "Keys in the grid. `default` works like Google Sheets; `vim` adds hjkl, counts, operators, " +9393 "visual selection and a : command line (File > Settings > Vim keys)."},9494 95- {Name: "max-cells", Kind: Int, Group: GroupData, Default: "2000000", Env: []string{"O12_MAX_CELLS"}, Live: true,96- Desc: "The most cells an import keeps, and a paste or fill writes at once. A sheet takes about " +97- "300 bytes a cell, so the default of two million is about 600 MB. Imports keep whole rows " +95+ {Name: "max-cells", Kind: Int, Group: GroupData, Default: "10000000", Env: []string{"O12_MAX_CELLS"}, Live: true,96+ Desc: "The most cells an import keeps, and a paste or fill writes at once. Numbers and text " +97+ "take 20 to 60 bytes a cell and formulas about 750, so the default of ten million cells of " +98+ "data is 200 to 600 MB. Imports keep whole rows " +9899 "up to the budget and say how many they left out; larger pastes and fills are refused. " +99100 "The grid itself is 1,048,576 rows by 16,384 columns (A to XFD) whatever this is."},100101 @@ -16,9 +16,9 @@ var (
1616 ErrFillTooBig = errors.New("That would write more cells than max-cells allows (see File > Settings)")1717 )1818 19-// DefaultMaxCells is the max-cells setting's default: about 600 MB of20-// cells at 300 bytes each.21-const DefaultMaxCells = 2_000_00019+// DefaultMaxCells is the max-cells setting's default: about 200 MB of20+// numbers at 20 bytes each (store.go).21+const DefaultMaxCells = 10_000_0002222 2323 // maxCells caps how many cells a paste or fill writes at once, and how2424 // many an import keeps, so an accidental whole-sheet selection or a huge@@ -244,6 +244,7 @@ func saveShapes() []namedBuild {
244244 {"dense-8192x26", func() *sheet.Sheet { return stress.Dense(stress.Rows, 26) }},245245 {"dense-8192x256", func() *sheet.Sheet { return stress.Dense(stress.Rows, stress.Cols) }},246246 {"chain-8192", func() *sheet.Sheet { return stress.Chain(stress.Rows) }},247+ {"dense-1Mx10", func() *sheet.Sheet { return stress.Dense(stress.MaxRows, stress.MaxCols) }},247248 }248249 }249250 @@ -256,6 +257,7 @@ func BenchmarkMemory(b *testing.B) {
256257 build func() *sheet.Sheet257258 }{258259 {"numbers", nil, func() *sheet.Sheet { return stress.Dense(stress.Rows, 64) }},260+ {"numbers-1Mx10", nil, func() *sheet.Sheet { return stress.Dense(stress.MaxRows, stress.MaxCols) }},259261 {"formulas", nil, func() *sheet.Sheet { return stress.Chain(stress.Rows) }},260262 {"text-200", nil, func() *sheet.Sheet { return stress.LongText(stress.Rows, 200) }},261263 {"open-8192x256", func() { denseFile() }, func() *sheet.Sheet {@@ -30,6 +30,13 @@ const (
3030 Cols = 2563131 )3232 33+// MaxRows x MaxCols is sheet.DefaultMaxCells of numbers, the most an34+// import keeps by default: a tall table, as imports make.35+const (36+ MaxRows = 1_000_00037+ MaxCols = 1038+)39+3340 func at(col, row int) sheet.Addr { return sheet.Addr{Col: col, Row: row} }3441 3542 func load(s *sheet.Sheet, a sheet.Addr, input string) {@@ -333,5 +340,6 @@ func Shapes() []Shape {
333340 {"criteria-60xSUMIF8192", func() *sheet.Sheet { return Criteria(Rows, 60) }, at(0, 4000), "7"},334341 {"lookup-300xVLOOKUP8192", func() *sheet.Sheet { return Lookup(Rows, 300) }, at(0, 4000), "4000"},335342 {"arrays-1000xFILTER8192", func() *sheet.Sheet { return Arrays(Rows, 1000) }, at(0, 4000), "7"},343+ {"dense-1Mx10", func() *sheet.Sheet { return Dense(MaxRows, MaxCols) }, at(0, 500000), "5"},336344 }337345 }