cat / 012
clone

a spreadsheet for the terminal: lotus 1-2-3 looks, google sheets keys and formulas, one go binary

Add a stress shape of 1000 FILTER and UNIQUE arrays over 8192 rows

Dami committed 2fc0c66
Half the formulas filter a column of numbers by one of eight
categories (1024 rows each), half spill the categories' UNIQUE list, all
from row 1 side by side, so an edit to a number recomputes 500 arrays.

Co-Authored-By: Claude <noreply@anthropic.com>
commit
2fc0c66812e856cab1c41c54d04caaa17821d35d
parent
c47bcc32771595bab38eb23582f9643b12667a34
author
Dami <dami.etoile@gmail.com>
1 file changed, +23 -0
Minternal/stress/gen.go23+++++++++++++++++++++++
M internal/stress/gen.go +23 -0
@@ -186,6 +186,28 @@ func RunningTotals(n int) *sheet.Sheet {
186186 return s187187 }188188 189+// Arrays is a column of n numbers beside a column of eight categories,190+// and k formulas in row 1 spilling from them, alternating a FILTER of the191+// numbers by one category (n/8 rows each) and the UNIQUE categories: k192+// arrays over n rows, every number's change recomputing half of them.193+func Arrays(n, k int) *sheet.Sheet {194+ s := sheet.New()195+ cats := []string{"alpha", "beta", "gamma", "delta", "epsilon", "zeta", "eta", "theta"}196+ for row := range n {197+ load(s, at(0, row), fmt.Sprint(row%100))198+ load(s, at(1, row), cats[row%len(cats)])199+ }200+ for i := range k {201+ f := fmt.Sprintf(`=FILTER(A1:A%d, B1:B%d="%s")`, n, n, cats[i/2%len(cats)])202+ if i%2 == 1 {203+ f = fmt.Sprintf("=UNIQUE(B1:B%d)", n)204+ }205+ load(s, at(2+i, 0), f)206+ }207+ s.RecalcAll()208+ return s209+}210+189211 // Volatile is k cells alternating TODAY() and RAND(), recalculated on190212 // every change anywhere.191213 func Volatile(k int) *sheet.Sheet {
@@ -310,5 +332,6 @@ func Shapes() []Shape {
310332 {"sparse-1M", func() *sheet.Sheet { return Sparse(10000, 100, 1000) }, at(0, 500000), "5"},311333 {"criteria-60xSUMIF8192", func() *sheet.Sheet { return Criteria(Rows, 60) }, at(0, 4000), "7"},312334 {"lookup-300xVLOOKUP8192", func() *sheet.Sheet { return Lookup(Rows, 300) }, at(0, 4000), "4000"},335+ {"arrays-1000xFILTER8192", func() *sheet.Sheet { return Arrays(Rows, 1000) }, at(0, 4000), "7"},313336 }314337 }