stress

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package stress builds synthetic worst-case sheets for the stress benchmarks (see docs/contributing/limits.md and `make stress`). Every generator is deterministic, so runs compare, and builds through the public API the way importers do: Load cell by cell, then one RecalcAll.

Index

Constants

View Source
const (
	Rows = 8192
	Cols = 256
)

Rows and Cols are the size of the shapes: the grid of Lotus 1-2-3 that 012 had before it grew to Excel's, so runs before and after compare.

View Source
const (
	MaxRows = 1_000_000
	MaxCols = 10
)

MaxRows x MaxCols is sheet.DefaultMaxCells of numbers, the most an import keeps by default: a tall table, as imports make.

Variables

This section is empty.

Functions

func Arrays added in v0.2.0

func Arrays(n, k int) *sheet.Sheet

Arrays is a column of n numbers beside a column of eight categories, and k formulas in row 1 spilling from them, alternating a FILTER of the numbers by one category (n/8 rows each) and the UNIQUE categories: k arrays over n rows, every number's change recomputing half of them.

func Chain

func Chain(n int) *sheet.Sheet

Chain is A1=1 and A(n)=A(n-1)+1 down n rows: the deepest dependency path, evaluated recursively.

func Charts

func Charts(s *sheet.Sheet, k int)

Charts adds k small column charts over a data block to s.

func Criteria

func Criteria(n, k int) *sheet.Sheet

Criteria is a table of n rows (a number, a category, an amount) and k conditional aggregates over whole columns of it: SUMIF, COUNTIFS with two conditions and AVERAGEIF in turn, each testing every row.

func Dense

func Dense(rows, cols int) *sheet.Sheet

Dense fills rows x cols with numbers: the storage and render bound.

func FanIn

func FanIn(n, k int) *sheet.Sheet

FanIn is a column of n numbers and k formulas that each SUM all of it: k range users over the same big range.

func FanInColumns

func FanInColumns(n, k int) *sheet.Sheet

FanInColumns is FanIn with whole-column ranges, =SUM(A:A): the same data, read through a range of a million rows.

func FanOut

func FanOut(k int) *sheet.Sheet

FanOut is one cell, A1, read directly by k formulas.

func Laidout added in v0.3.0

func Laidout(rows, cols int) *sheet.Sheet

Laidout is a report of rows x cols: every cell bordered, a last column of notes that wrap over three lines, and a title merged across the top: what borders, tall rows and merged cells cost a frame.

func LongText

func LongText(rows, n int) *sheet.Sheet

LongText puts a length-n line of text, mixing ASCII, accents, CJK and emoji, in column A of rows rows and leaves everything else blank, so every row overflows across the whole screen.

func Lookup

func Lookup(n, k int) *sheet.Sheet

Lookup is n keys with a value beside each and k exact lookups into them: VLOOKUP, MATCH and XLOOKUP in turn, each key found somewhere along the column.

func Names

func Names(k int) *sheet.Sheet

Names defines k named ranges over a column of 8192 numbers and a formula using each: every changed cell is checked against every name.

func Nested

func Nested(depth int) string

Nested is a formula nested depth levels deep, e.g. =((((1+1)+1)+1)+1), in A1: the parser's and evaluator's recursion.

func NestedIF

func NestedIF(depth int) string

NestedIF is =IF(A1>0,IF(A1>1,...,0),0) depth levels deep.

func RunningTotals

func RunningTotals(n int) *sheet.Sheet

RunningTotals is n numbers with a running SUM beside each: n overlapping ranges of growing size, O(n^2) cells read in all.

func Sparse

func Sparse(n, stride, k int) *sheet.Sheet

Sparse is a tall, sparse sheet: n numbers every stride rows down column A, a label beside each, and k of each of three formulas over whole columns: =SUM(A:A), running totals to every thousandth row, and =VLOOKUP over A:B. Its cost should follow its n cells, not the million rows they span.

func Table

func Table(rows, cols int) *sheet.Sheet

Table is a filterable, sortable table: a header row and rows rows of an id, a category, a number and a date-like text, in cols columns.

func Volatile

func Volatile(k int) *sheet.Sheet

Volatile is k cells alternating TODAY() and RAND(), recalculated on every change anywhere.

Types

type Shape

type Shape struct {
	Name  string
	Build func() *sheet.Sheet
	// Edit is a cell whose change touches the shape's interesting
	// topology, for single-edit latency, and the entry to type there.
	Edit  sheet.Addr
	Input string
}

Shape is one synthetic sheet: a name for benchmark output, and a builder. Rows and Cols describe the populated area.

func Shapes

func Shapes() []Shape

Shapes are the edit-latency topologies at their stress sizes.

Directories

Path Synopsis
Command benchrec turns `go test -bench` output into run records, one JSON line per benchmark, appended to a results file that DuckDB (and ClickHouse) read; see scripts/stress and docs/contributing/observability.md.
Command benchrec turns `go test -bench` output into run records, one JSON line per benchmark, appended to a results file that DuckDB (and ClickHouse) read; see scripts/stress and docs/contributing/observability.md.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL